/* Soluzione Taxfree · Profilazione — sistema grafico (stile Proposta A corporate)
   Colori: blu #0E1630, oro #C9A84C, bianco. Carattere: Helvetica Neue.
   Spazi su griglia di 4px: 4 · 8 · 12 · 16 · 24 · 32 · 48 · 64. */
:root {
  --navy: #0E1630; --navy-2: #16204A; --navy-3: #1E2A5A;
  --gold: #C9A84C; --gold-l: #E4C46A; --gold-d: #8B6A2E; --gold-bg: #FBF6E8;
  --ink: #0E1630; --text: #23262E; --muted: #5B5F6B; --faint: #6B6F7B;
  --line: #E6E2D8; --line-2: #D9D4C7; --bg: #F6F6F3; --card: #FFFFFF; --field: #FCFBF8;
  --ok: #1F7A4D; --ok-bg: #E9F5EE; --err: #B3261E; --err-bg: #FCEDEC; --warn-bg: #FBF3DE;
  --r-s: 8px; --r-m: 12px; --r-l: 16px;
  --sh-1: 0 1px 2px rgba(14,22,48,.06), 0 1px 1px rgba(14,22,48,.04);
  --sh-2: 0 8px 24px rgba(14,22,48,.10), 0 2px 6px rgba(14,22,48,.06);
  --sh-3: 0 24px 64px rgba(14,22,48,.22);
  --font: 'Helvetica Neue', Helvetica, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; min-height: 100vh; display: flex; flex-direction: column; }
b, strong { font-weight: 600; color: var(--ink); }
a { color: var(--gold-d); text-decoration: none; }
a:hover { text-decoration: underline; }
p + p { margin-top: 12px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.nascosto { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- barra in alto ---------- */
.top { background: var(--navy); border-bottom: 1px solid var(--gold); position: sticky; top: 0; z-index: 20; }
.top .in { max-width: 920px; margin: 0 auto; height: 64px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top img { height: 30px; display: block; }
.top .dx { display: flex; align-items: center; gap: 16px; font-size: 13px; color: #B9BCC6; }
.top .dx a, .top .dx button.link { color: var(--gold-l); font: inherit; background: none; border: 0; cursor: pointer; }
.stato-salv { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #B9BCC6; white-space: nowrap; }
.stato-salv i { width: 8px; height: 8px; border-radius: 50%; background: #6F7486; }
.stato-salv.ok i { background: #4CC38A; } .stato-salv.va i { background: var(--gold-l); animation: pulsa 1s infinite; } .stato-salv.ko i { background: #F07167; }
@keyframes pulsa { 50% { opacity: .35; } }

.wrap { width: 100%; max-width: 920px; margin: 0 auto; padding: 32px 24px 64px; flex: 1; }
.wrap.stretto { max-width: 480px; }

/* ---------- testata scura ---------- */
.hero { position: relative; overflow: hidden; background: var(--navy); color: #fff; border-radius: var(--r-l); padding: 40px 40px 36px; box-shadow: var(--sh-2); }
.hero::before { content: ""; position: absolute; inset: 0; background: url('/img/mappa.jpg') center 42% / cover no-repeat; opacity: .32; mix-blend-mode: screen; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,22,48,0) 0%, rgba(14,22,48,.55) 100%); }
.hero > * { position: relative; z-index: 1; }
.kicker { font-size: 13px; font-weight: 500; letter-spacing: .04em; color: var(--gold-l); }
.hero h1 { font-size: 36px; line-height: 1.15; font-weight: 500; letter-spacing: -.015em; margin-top: 8px; }
.hero .meta { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px 32px; font-size: 14px; color: #B9BCC6; }
.hero .meta b { display: block; color: #fff; font-weight: 500; font-size: 17px; margin-top: 2px; }

/* ---------- schede ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--sh-1); padding: 32px; margin-top: 24px; }
.card h2 { font-size: 24px; line-height: 1.25; font-weight: 500; letter-spacing: -.01em; color: var(--ink); }
.card h2 .n { color: var(--gold-d); margin-right: 10px; }
.card .lead { color: var(--muted); font-size: 15px; line-height: 1.6; margin-top: 8px; }
.nota { font-size: 14px; line-height: 1.55; color: var(--muted); }
.avviso { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--r-m); padding: 16px 18px; font-size: 15px; line-height: 1.55; }
.avviso.oro { background: var(--gold-bg); border: 1px solid #EAD9A6; color: #5A4A22; }
.avviso.err { background: var(--err-bg); border: 1px solid #F3C9C5; color: #7A1D17; }
.avviso.ok { background: var(--ok-bg); border: 1px solid #BFE3CF; color: #14532F; }
.istr { border-left: 4px solid var(--gold); }
.istr p { font-size: 15px; line-height: 1.65; color: var(--muted); }

/* ---------- pulsanti ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: var(--r-m); border: 1px solid transparent; font: inherit; font-size: 15px; font-weight: 500; letter-spacing: .005em; cursor: pointer; transition: background .15s var(--ease), transform .1s var(--ease), box-shadow .15s var(--ease), opacity .15s; white-space: nowrap; text-decoration: none !important; }
.btn:active { transform: scale(.98); }
.btn.pri { background: var(--navy); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, var(--sh-1); }
.btn.pri:hover { background: var(--navy-3); }
.btn.oro { background: var(--gold); color: var(--navy); }
.btn.oro:hover { background: #D4B55C; }
.btn.sec { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn.sec:hover { border-color: var(--gold); }
.btn.ghost { background: transparent; color: var(--muted); padding: 0 12px; }
.btn.ghost:hover { color: var(--ink); background: rgba(14,22,48,.04); }
.btn.peric { background: #fff; color: var(--err); border-color: #EBC3BF; }
.btn.peric.pieno { background: var(--err); color: #fff; border-color: var(--err); }
.btn.picc { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn.largo { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn .gira { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: gira .7s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.link { background: none; border: 0; font: inherit; color: var(--gold-d); cursor: pointer; padding: 0; font-weight: 500; }
.link:disabled { color: var(--faint); cursor: default; font-weight: 400; }

/* ---------- campi ---------- */
label.et { display: block; font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 8px; }
label.et small { font-weight: 400; color: var(--faint); margin-left: 6px; }
.campo + .campo { margin-top: 16px; }
.aiuto { font-size: 13px; color: var(--faint); margin-top: 6px; line-height: 1.5; }
input[type=text], input[type=email], input[type=search], textarea { width: 100%; border: 1px solid var(--line-2); border-radius: var(--r-m); background: var(--field); padding: 12px 14px; font: inherit; font-size: 16px; line-height: 1.55; color: var(--text); transition: border-color .15s, box-shadow .15s, background .15s; -webkit-appearance: none; }
textarea { resize: none; min-height: 52px; overflow: hidden; }
input::placeholder, textarea::placeholder { color: #A9ACB5; }
input:focus, textarea:focus { outline: none; border-color: var(--gold); background: #fff; box-shadow: 0 0 0 4px rgba(201,168,76,.16); }
input:disabled, textarea:disabled { background: #F3F2EE; color: var(--muted); }
.ricerca { position: relative; }
.ricerca input { padding-left: 42px; }
.ricerca svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); }

/* codice a 8 cifre */
.otp { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin-top: 8px; }
.otp input { text-align: center; font-size: 22px; font-weight: 500; padding: 0; height: 56px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.otp .sep { display: none; }
.otp.err input { border-color: #E3A39D; background: #FFF8F7; animation: scuoti .3s; }
@keyframes scuoti { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ---------- pillole e stati ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.attesa { background: #F0F0EC; color: #6B6E78; }
.pill.corso { background: var(--gold-bg); color: #8A6A1F; }
.pill.inviata { background: var(--ok-bg); color: var(--ok); }
.pill.scaduto { background: var(--err-bg); color: var(--err); }
.prog { height: 6px; background: #ECE8DD; border-radius: 3px; overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-d), var(--gold)); border-radius: 3px; transition: width .4s var(--ease); }

/* ---------- passi del questionario ---------- */
.passi { display: flex; gap: 8px; margin-top: 32px; overflow-x: auto; scrollbar-width: none; padding: 2px; scroll-snap-type: x proximity; }
.passi::-webkit-scrollbar { display: none; }
.passi button { flex: 0 0 auto; scroll-snap-align: start; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; transition: all .15s var(--ease); }
.passi button .c { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: #F2EFE6; color: var(--gold-d); }
.passi button.fatto .c { background: var(--gold); color: var(--navy); }
.passi button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.passi button.on .c { background: var(--gold); color: var(--navy); }
.avanz { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.avanz .prog { flex: 1; }
.avanz span { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* domande */
.sez-testa { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.sez-testa .conta { font-size: 13px; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.q { display: grid; grid-template-columns: 44px 1fr; gap: 0 12px; padding: 24px 0; border-top: 1px solid var(--line); }
.sez-testa + .q { border-top: 0; }
.q .n { font-size: 15px; font-weight: 600; color: var(--gold-d); line-height: 1.5; font-variant-numeric: tabular-nums; }
.q .t { font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.q .corpo { grid-column: 2; margin-top: 12px; }
.chips { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.chip { height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; transition: border-color .15s, color .15s; }
.chip:hover { border-color: var(--gold); color: var(--ink); }
.seg { display: inline-flex; padding: 4px; gap: 4px; background: #F1EFE8; border-radius: 12px; flex-wrap: wrap; }
.seg button { min-width: 88px; height: 44px; padding: 0 18px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; transition: all .15s var(--ease); }
.seg button.on { background: var(--navy); color: #fff; box-shadow: var(--sh-1); }
.det { margin-top: 14px; }
.det .et-det { font-size: 14px; color: var(--muted); margin-bottom: 8px; }

.nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; }

/* documenti */
.drop { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 1.5px dashed var(--line-2); border-radius: var(--r-l); padding: 36px 24px; text-align: center; color: var(--muted); cursor: pointer; background: var(--field); transition: all .15s var(--ease); margin-top: 24px; }
.drop:hover, .drop.su { border-color: var(--gold); background: var(--gold-bg); }
.drop svg { color: var(--gold-d); }
.drop b { font-size: 16px; }
.drop small { font-size: 13px; color: var(--faint); }
.files { margin-top: 16px; display: grid; gap: 8px; }
.file { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-m); background: #fff; }
.file .ic { width: 40px; height: 40px; border-radius: 10px; background: #F2EFE6; color: var(--gold-d); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.file .nm { font-size: 15px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .sz { font-size: 13px; color: var(--faint); }
.file .prog { margin-top: 6px; }
.file.ko { border-color: #F3C9C5; background: #FFFAF9; }

.consenso { display: grid; grid-template-columns: 24px 1fr; gap: 14px; align-items: start; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--field); cursor: pointer; font-size: 15px; line-height: 1.6; color: var(--muted); }
.consenso input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--navy); }

.fine { text-align: center; padding: 48px 24px; }
.fine .ico { width: 72px; height: 72px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--navy); color: var(--gold-l); border: 2px solid var(--gold); box-shadow: var(--sh-2); }
.fine h2 { margin-top: 20px; }
.fine p { max-width: 460px; margin: 12px auto 0; color: var(--muted); }

/* ---------- area riservata ---------- */
.login { margin-top: 8vh; }
.login .card { padding: 40px 36px; margin-top: 0; }
.login .logo-bl { width: 56px; height: 56px; border-radius: 16px; background: var(--navy); display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-2); }
.login .logo-bl img { width: 34px; height: 34px; }
.login h1 { font-size: 26px; font-weight: 500; letter-spacing: -.012em; color: var(--ink); margin-top: 24px; line-height: 1.2; }
.login .sotto { color: var(--muted); font-size: 15px; margin-top: 8px; line-height: 1.6; }
.login .azioni { margin-top: 28px; }
.login .rinvio { margin-top: 20px; font-size: 14px; color: var(--muted); text-align: center; }
.login .msg { margin-top: 16px; }
.riepilogo { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 24px; }
.riepilogo button { text-align: left; font: inherit; cursor: pointer; background: #fff; border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px 18px; box-shadow: var(--sh-1); transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.riepilogo button:hover { border-color: var(--gold); }
.riepilogo button.on { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy) inset, var(--sh-1); }
.riepilogo b { display: block; font-size: 26px; font-weight: 500; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.riepilogo span { font-size: 13px; color: var(--muted); }
.barra-az { display: flex; gap: 12px; margin-top: 24px; align-items: center; }
.barra-az .ricerca { flex: 1; }
.lista { margin-top: 16px; display: grid; gap: 12px; }
.cli { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); padding: 20px 22px; box-shadow: var(--sh-1); transition: box-shadow .15s var(--ease), border-color .15s; cursor: pointer; }
.cli:hover { box-shadow: var(--sh-2); border-color: var(--line-2); }
.cli .nm { font-size: 17px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cli .inf { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.cli .prog { margin-top: 12px; max-width: 360px; }
.cli .az { display: flex; gap: 8px; align-items: center; }
.vuoto { text-align: center; padding: 56px 24px; color: var(--muted); }
.vuoto b { display: block; font-size: 17px; margin-bottom: 6px; }
.menu { position: relative; }
.menu .tendina { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--sh-2); padding: 6px; z-index: 30; }
.menu .tendina button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 8px; font: inherit; font-size: 14.5px; color: var(--text); cursor: pointer; }
.menu .tendina button:hover { background: #F5F3EC; }
.menu .tendina button.peric { color: var(--err); }
.risp .v { grid-column: 2; margin-top: 8px; white-space: pre-wrap; font-size: 15.5px; line-height: 1.65; color: var(--text); }
.risp .v.vuota { color: var(--faint); font-style: italic; }
.linkbox { margin-top: 20px; padding: 16px; border-radius: var(--r-m); background: var(--gold-bg); border: 1px solid #EAD9A6; }
.linkbox code { display: block; font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: #4D3F1C; word-break: break-all; line-height: 1.5; }
.linkbox .az { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* finestra di conferma e avvisi */
.velo { position: fixed; inset: 0; background: rgba(14,22,48,.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 50; animation: appare .15s var(--ease); }
.modale { background: #fff; border-radius: 18px; box-shadow: var(--sh-3); width: 100%; max-width: 480px; padding: 28px; animation: sale .2s var(--ease); max-height: 90vh; overflow: auto; }
.modale h3 { font-size: 20px; font-weight: 500; color: var(--ink); line-height: 1.3; }
.modale p.t { margin-top: 8px; color: var(--muted); font-size: 15px; }
.modale .piede { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.modale form { margin-top: 20px; }
@keyframes appare { from { opacity: 0; } }
@keyframes sale { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--sh-3); font-size: 14.5px; z-index: 60; display: flex; align-items: center; gap: 10px; animation: sale .2s var(--ease); max-width: calc(100% - 32px); }
.toast.err { background: var(--err); }

.piede-pag { border-top: 1px solid var(--line); }
.piede-pag .in { max-width: 920px; margin: 0 auto; padding: 20px 24px 28px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--faint); }
.scheletro { background: linear-gradient(90deg, #EEECE6 25%, #F6F5F1 50%, #EEECE6 75%); background-size: 200% 100%; animation: luce 1.2s infinite; border-radius: 10px; }
@keyframes luce { to { background-position: -200% 0; } }

@media (max-width: 680px) {
  .top .in { height: 56px; padding: 0 16px; } .top img { height: 24px; }
  .wrap { padding: 20px 16px 48px; }
  .hero { padding: 28px 22px 24px; border-radius: 14px; } .hero h1 { font-size: 28px; }
  .card { padding: 24px 18px; border-radius: 14px; margin-top: 16px; } .card h2 { font-size: 21px; }
  .q { grid-template-columns: 1fr; padding: 20px 0; } .q .n { margin-bottom: 2px; } .q .corpo, .risp .v { grid-column: 1; }
  .riepilogo { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; } .riepilogo button { padding: 10px 8px; text-align: center; } .riepilogo b { font-size: 20px; } .riepilogo span { font-size: 11px; line-height: 1.25; display: block; } .toast { bottom: 88px; }
  .cli { grid-template-columns: 1fr; padding: 18px; } .cli .az { justify-content: flex-start; }
  .barra-az { flex-direction: column; align-items: stretch; }
  .otp { gap: 5px; } .otp input { height: 50px; font-size: 20px; }
  .login { margin-top: 2vh; } .login .card { padding: 32px 22px; }
  .nav .btn { flex: 1; }
}
@media print {
  .top { position: static; } .noprint, .toast, .velo { display: none !important; }
  body { background: #fff; } .card { box-shadow: none; border: 0; padding: 0; margin-top: 24px; } .q { break-inside: avoid; } .hero { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
