/* Colori e misure dalla tavola "Robin Hood · Schermate e flussi" (design/project, M1–M4). */
:root {
  --bg: #F3F1EA;
  --surface: #FFFFFF;
  --text: #16211B;
  --muted: #5B625D;
  --border: #D9D5CA;
  --green: #1F6B3A;
  --green-dark: #164F2B;
  --green-tint: #E4F0E8;
  --gold: #C9922E;
  --gold-tint: #F7EBD3;
  --red: #B3122E;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
#app { min-height: 100%; display: flex; flex-direction: column; }

.bar {
  position: sticky; top: 0; z-index: 1;
  height: 56px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px;
  background: var(--green-dark); color: #fff;
}
.bar-title { font-size: 16px; font-weight: 700; }
.bar-btn {
  width: 44px; height: 44px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; color: inherit; cursor: pointer;
}
.bar-btn[hidden] { display: flex; visibility: hidden; }

.page {
  flex-grow: 1; width: 100%; max-width: 480px; margin: 0 auto;
  padding: 16px 20px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
}
.center { text-align: center; }
.grow { flex-grow: 1; }

h1 { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 800; white-space: pre-line; }
h2 { margin: 0; font-size: 16px; line-height: 1.25; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.label { font-size: 15px; font-weight: 700; color: var(--muted); }

.hero { display: flex; justify-content: center; padding: 6px 0 2px; }
.hero svg { animation: float 3.2s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .hero svg { animation: none; } }

.chip {
  align-self: center; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--gold-tint); font-size: 13px; font-weight: 700;
}
.chip::before { content: ''; width: 8px; height: 8px; border-radius: 4px; background: var(--gold); }

.card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px;
}
button.choice {
  flex-direction: row; gap: 14px; align-items: center;
  width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.choice-icon {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--green-tint); color: var(--green-dark);
}
.choice-icon.gold { background: var(--gold-tint); color: var(--gold); }
.choice-title { font-size: 16px; font-weight: 700; }
.banner { background: var(--green-dark); color: #fff; border: 0; }
.banner .small { color: #fff; opacity: .85; }

.btn {
  width: 100%; min-height: 52px; padding: 0 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px; border: 1px solid var(--green);
  background: var(--green); color: #fff;
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.btn.outline { background: transparent; color: var(--green); }
.btn.danger { border-color: var(--red); color: var(--red); background: transparent; }
.btn.compact { min-height: 44px; font-size: 15px; }
.btn[disabled] { opacity: .6; cursor: default; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=email], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  font: inherit; font-size: 16px;
}
textarea { min-height: 72px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--green); outline-offset: 2px;
}
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.check input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--green); }
.err { color: var(--red); font-size: 13px; font-weight: 600; }
.err:empty { display: none; }

.steps { display: flex; flex-direction: column; gap: 12px; margin: 4px 0; padding: 0; list-style: none; }
.steps li { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.steps .dot {
  width: 28px; height: 28px; flex: none; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; font-weight: 700;
}
.steps li.on { color: var(--text); }
.steps li.on .dot { background: var(--green); border-color: var(--green); color: #fff; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.tag {
  align-self: flex-start; padding: 2px 10px; border-radius: 999px;
  background: var(--green-tint); color: var(--green-dark); font-size: 12px; font-weight: 700;
}
.tag.gold { background: var(--gold-tint); color: #7A5514; }
.lang { display: flex; gap: 8px; align-items: center; justify-content: center; }
.lang button {
  min-width: 44px; min-height: 36px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer;
}
.lang button[aria-pressed=true] { background: var(--green-tint); color: var(--green-dark); border-color: var(--green-tint); }

/* Dashboard: schede, riquadri numerici, codice da installare, esito della verifica. */
.page.wide { max-width: 720px; }
.tab-body { display: flex; flex-direction: column; gap: 14px; }
.tabs {
  display: flex; gap: 6px; margin: -4px -4px 0; padding: 4px;
  overflow-x: auto; scrollbar-width: none;
}
.tabs button {
  flex: none; min-height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--border);
  background: transparent; color: var(--muted);
  font: inherit; font-weight: 700; cursor: pointer;
}
.tabs button[aria-current=page] { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { gap: 2px; padding: 14px 16px; }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.code {
  margin: 0; padding: 12px; overflow-x: auto;
  background: #16211B; color: #E4F0E8; border-radius: 12px;
  font: 500 12px/1.6 ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  white-space: pre;
}
a.btn { text-decoration: none; }
.checks dd.good { color: var(--green); font-weight: 700; }
.checks dd.bad { color: var(--red); font-weight: 700; }
