/* SignBridge — l'app. I colori sono le variabili del Sistema (pagina «Sistema» del file Figma),
   le misure del testo sono i 15 stili. Niente colori scritti a mano fuori da :root. */

:root {
  --fondo: #FBFAF8;
  --testo: #14161A;
  --testo-2: #5A5D66;
  --in-corso: #6E7078;
  --l1-sup: #D9EAF7;
  --l1-acc: #175A80;
  --l2-sup: #E6DFF8;
  --l2-acc: #5B3FC4;
  --l2-prem: #47309C;
  --l2-tenue: #F3F0FC;
  --l2-scuro: #432E93;
  --bianca: #FFFFFF;
  --bordo: #B9B3AA;
  --spento: #EDEAE5;
  --spento-bordo: #C9C4BC;
  --dubbio: #FBF0C9;
  --dubbio-linea: #A3801B;
  --confine: #FBF3F3;
  --confine-linea: #A31621;
  --sai: #E4F2E8;
  --sai-riga: #F3F9F5;
  --sai-linea: #1B6B3A;
  --grad-1: #81BAE6;
  --grad-2: #A693E6;
  --scuro: #1E2026;
  --anello: rgba(91, 63, 196, .28);
  --scala: 1;               /* «testo più grande» la porta a 1.2 */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--fondo);
  color: var(--testo);
  font-size: 19px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; text-align: left; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.nascosto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* sul computer l'app resta alla larghezza di un telefono, al centro */
@media (min-width: 560px) {
  body { background: #E7E3DD; }
  #app { max-width: 430px; margin: 0 auto; box-shadow: 0 0 0 1px var(--spento-bordo), 0 30px 80px rgba(20, 22, 26, .12); }
}

#app { min-height: 100dvh; background: var(--fondo); position: relative; }

.schermo {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 24px calc(env(safe-area-inset-bottom, 0px) + 24px);
  animation: entra .2s ease-out;
}
@keyframes entra { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .schermo, .foglio, .velo { animation: none !important; } }

/* ---------------------------------------------------------------- testata */
.testa { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; min-height: 48px; }
.titolo { font-size: 26px; font-weight: 600; line-height: 1.2; flex: 1; }
.tondo {
  width: 48px; height: 48px; border-radius: 12px; border: 2px solid var(--testo-2);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto; color: var(--testo);
  background: var(--fondo);
}
.tondo svg { width: 22px; height: 22px; }
.tondo:active { background: var(--spento); }

/* ---------------------------------------------------------------- testi */
.etichetta { font-size: 14px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--testo-2); margin: 20px 0 10px; line-height: 1; }
.etichetta:first-child { margin-top: 4px; }
.corpo { font-size: 19px; line-height: 1.5; }
.corpo-2 { font-size: 17px; line-height: 1.45; color: var(--testo-2); }
.nota { font-size: 14px; line-height: 1.4; color: var(--testo-2); }
.nota b { color: var(--testo); font-weight: 600; }
.vuoto { font-size: 26px; line-height: 1.35; color: var(--testo-2); margin: 8px 0 14px; }

/* ---------------------------------------------------------------- pulsanti */
.azioni { margin-top: auto; padding-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.btn {
  display: flex; align-items: center; justify-content: center; text-align: center; gap: 10px;
  min-height: 56px; border-radius: 16px; padding: 14px 18px;
  font-size: 19px; font-weight: 600; line-height: 1.25;
  background: var(--l2-acc); color: var(--bianca); border: 2px solid var(--l2-acc);
  width: 100%; text-decoration: none;
}
.btn:active { background: var(--l2-prem); box-shadow: 0 0 0 4px var(--anello); }
.btn.sec { background: var(--bianca); color: var(--testo); border-color: var(--testo); }
.btn.sec:active { background: var(--spento); box-shadow: none; }
.btn.pericolo { background: var(--confine-linea); border-color: var(--confine-linea); }
.btn:disabled { background: var(--spento); color: var(--testo-2); border-color: var(--spento-bordo); box-shadow: none; }
.btn svg { width: 22px; height: 22px; flex: 0 0 auto; }
:focus-visible { outline: 3px solid var(--l2-acc); outline-offset: 3px; }

.link { font-size: 17px; font-weight: 600; color: var(--l2-acc); text-decoration: underline; text-underline-offset: 3px; padding: 12px 0; min-height: 44px; display: inline-flex; align-items: center; }

/* ---------------------------------------------------------------- righe */
.rq {
  display: block; width: 100%; background: var(--bianca); border: 2px solid var(--bordo); border-radius: 16px;
  padding: 15px 17px; font-size: 19px; font-weight: 600; line-height: 1.3; margin-bottom: 12px; min-height: 56px;
}
.rq .quando { display: block; font-size: 14px; font-weight: 400; color: var(--testo-2); margin-top: 5px; letter-spacing: .02em; }
.rq:active { border-color: var(--l2-acc); background: var(--l2-tenue); }
.riga-mod { display: flex; gap: 10px; align-items: stretch; }
.riga-mod .rq { flex: 1; }
.togli { width: 56px; border-radius: 16px; border: 2px solid var(--confine-linea); color: var(--confine-linea); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; flex: 0 0 auto; background: var(--bianca); }
.togli svg { width: 22px; height: 22px; }
.sez-testa { display: flex; align-items: baseline; justify-content: space-between; }
.sez-testa .link { font-size: 15px; padding: 8px 0; }

/* ---------------------------------------------------------------- scelte (chi sei, contesto, impostazioni) */
.scelta {
  display: block; width: 100%; background: var(--l1-sup); border: 2px solid var(--l1-acc); border-radius: 18px;
  padding: 20px; margin-bottom: 14px;
}
.scelta.l2 { background: var(--l2-sup); border-color: var(--l2-acc); }
.scelta .h { font-size: 24px; font-weight: 700; line-height: 1.25; display: block; }
.scelta .b { font-size: 17px; line-height: 1.45; display: block; margin-top: 8px; }

.voce {
  display: flex; align-items: center; gap: 13px; width: 100%; background: var(--bianca);
  border: 2px solid var(--bordo); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; min-height: 56px;
}
.voce .p { font-size: 19px; font-weight: 600; line-height: 1.25; flex: 1; }
.voce .p small { display: block; font-size: 14px; font-weight: 400; color: var(--testo-2); margin-top: 4px; }
.voce .chev { color: var(--testo-2); flex: 0 0 auto; }
.voce .chev svg { width: 20px; height: 20px; display: block; }
.voce.on { border-color: var(--l2-acc); background: var(--l2-tenue); }
.voce.sai { border-left: 6px solid var(--sai-linea); background: var(--sai-riga); }
.voce .spunta-v { color: var(--l2-acc); }
.mk { width: 16px; height: 16px; flex: 0 0 auto; }
.mk.sai { background: var(--sai-linea); border-radius: 4px; }
.mk.no { border: 2.5px solid #8B8579; border-radius: 50%; }
.legenda { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--testo-2); margin: 2px 0 6px; flex-wrap: wrap; }
.legenda .mk { width: 13px; height: 13px; }
.legenda span + .mk { margin-left: 10px; }

.modulo { display: flex; align-items: center; gap: 10px; background: var(--l2-sup); border: 2px solid var(--l2-acc); border-radius: 14px; padding: 6px 6px 6px 15px; font-size: 17px; font-weight: 600; color: var(--l2-scuro); margin-bottom: 14px; }
.modulo .link { margin-left: auto; padding: 8px 10px; font-size: 16px; }
.avanz { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; background: var(--bianca); border: 2px solid var(--bordo); border-radius: 14px; padding: 10px 15px; margin-bottom: 14px; font-size: 17px; font-weight: 600; }
.avanz .conto { color: var(--sai-linea); }
.avanz .chev { margin-left: auto; color: var(--testo-2); }
.avanz .chev svg { width: 20px; height: 20px; display: block; }

/* ---------------------------------------------------------------- mostra */
.fascia { background: var(--l1-sup); border: 2px solid var(--l1-acc); border-radius: 14px; padding: 17px; font-size: calc(22px * var(--scala)); line-height: 1.32; font-weight: 600; }
.fascia.piccola { font-size: 17px; padding: 12px 15px; border-radius: 12px; font-weight: 600; }
.messaggio { font-size: calc(32px * var(--scala)); font-weight: 600; line-height: 1.28; margin-top: 22px; overflow-wrap: anywhere; }
.messaggio.normale { font-size: calc(28px * var(--scala)); }
.mostra-cosa { align-self: flex-end; margin-top: 18px; }
.fotogrande { width: 100%; flex: 1; min-height: 220px; max-height: 52dvh; object-fit: contain; border-radius: 17px; background: var(--spento); border: 2px solid var(--bordo); margin-top: 18px; }
.giro { transform: rotate(180deg); }

/* ---------------------------------------------------------------- scrivi */
.campo {
  width: 100%; min-height: 170px; border: 2px solid var(--testo-2); border-radius: 14px; padding: 15px;
  font-size: 19px; line-height: 1.45; background: var(--bianca); resize: none; outline: none;
}
.campo:focus { border-color: var(--l2-acc); box-shadow: 0 0 0 4px var(--anello); }
.campo.basso { min-height: 120px; }
.campo.riga { min-height: 0; height: 56px; padding: 0 15px 0 48px; }
.check { display: flex; align-items: flex-start; gap: 12px; font-size: 17px; line-height: 1.35; margin-top: 16px; min-height: 44px; cursor: pointer; }
.check input { appearance: none; -webkit-appearance: none; width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--testo-2); flex: 0 0 auto; background: var(--bianca); display: grid; place-items: center; margin-top: -2px; }
.check input:checked { background: var(--l2-acc); border-color: var(--l2-acc); }
.check input:checked::after { content: ""; width: 12px; height: 7px; border: 3px solid var(--bianca); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }

/* ---------------------------------------------------------------- stati di ascolto */
.stato { border-radius: 14px; padding: 13px 15px; display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 600; line-height: 1.25; }
.stato.grigio { background: var(--spento); border: 2px solid var(--testo-2); }
.stato.asc { background: var(--l2-sup); border: 2px solid var(--l2-acc); color: var(--l2-acc); }
.stato .dot { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; background: var(--testo-2); }
.stato.asc .dot { background: var(--l2-acc); animation: pulsa 1.2s ease-in-out infinite; }
@keyframes pulsa { 50% { transform: scale(.55); opacity: .5; } }
.chip { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--l2-acc); background: var(--bianca); border: 2px solid var(--l2-acc); border-radius: 10px; padding: 8px 11px; min-height: 44px; display: inline-flex; align-items: center; white-space: nowrap; }
.trascr { font-size: calc(28px * var(--scala)); line-height: 1.35; margin-top: 22px; overflow-wrap: anywhere; }
.trascr .in-corso { color: var(--in-corso); }
.dub { border-bottom: 3px solid var(--dubbio-linea); background: var(--dubbio); padding: 4px 5px; border-radius: 4px; font: inherit; color: inherit; cursor: pointer; display: inline-block; line-height: inherit; min-height: 44px; }
.avviso { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; font-size: 14px; line-height: 1.4; color: var(--testo-2); }
.avviso::before { content: ""; width: 4px; align-self: stretch; background: var(--dubbio-linea); border-radius: 2px; flex: 0 0 auto; }
.avviso b { color: var(--testo); }
.spiega { font-size: 19px; line-height: 1.5; margin-top: 18px; }
.spiega .q { display: block; color: var(--testo-2); font-size: 17px; margin-top: 14px; }

/* ---------------------------------------------------------------- scambio */
.turno { margin-bottom: 14px; }
.turno .chi { font-size: 14px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; margin-bottom: 6px; }
.turno .bolla { border-radius: 16px; padding: 14px 16px; font-size: 19px; line-height: 1.4; overflow-wrap: anywhere; }
.turno.io .chi { color: var(--l1-acc); }
.turno.io .bolla { background: var(--l1-sup); border: 2px solid var(--l1-acc); }
.turno.lui .chi { color: var(--l2-acc); }
.turno.lui .bolla { background: var(--l2-sup); border: 2px solid var(--l2-acc); }
.turno .bolla img { border-radius: 10px; max-height: 200px; object-fit: cover; }

/* ---------------------------------------------------------------- fine */
.grad { margin: calc(-18px - env(safe-area-inset-top, 0px)) -24px 0; padding-top: env(safe-area-inset-top, 0px); height: calc(230px + env(safe-area-inset-top, 0px)); background: linear-gradient(115deg, var(--grad-1), var(--grad-2)); display: flex; align-items: center; justify-content: center; }
.spunta { width: 88px; height: 88px; border-radius: 50%; background: var(--fondo); display: flex; align-items: center; justify-content: center; color: var(--l1-acc); }
.spunta svg { width: 40px; height: 40px; }
.fatto { font-size: 32px; font-weight: 600; line-height: 1.2; margin-top: 26px; }
.citazione { font-size: 17px; line-height: 1.45; color: var(--testo-2); margin-top: 16px; font-style: italic; }

/* ---------------------------------------------------------------- avvio */
.avvio { min-height: 100dvh; background: linear-gradient(115deg, var(--grad-1), var(--grad-2)); display: flex; align-items: center; justify-content: center; }
.marchio { font-size: 38px; font-weight: 600; line-height: 1; letter-spacing: -.01em; }

/* ---------------------------------------------------------------- foto */
.griglia { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.griglia .cella { position: relative; }
.griglia .foto { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 14px; border: 2px solid var(--bordo); background: var(--spento); }
.griglia .cella > button:first-child { display: block; width: 100%; border-radius: 14px; }
.griglia .togli { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; margin: 0; border-radius: 12px; }

/* ---------------------------------------------------------------- il mestiere */
.cerca-box { position: relative; margin-bottom: 16px; }
.cerca-box svg { position: absolute; left: 15px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); color: var(--testo-2); pointer-events: none; }
.schermo-video { border-radius: 18px; background: var(--scuro); border: 2px solid var(--testo); flex: 1; min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; text-align: center; color: #D6D2CB; position: relative; overflow: hidden; }
.schermo-video .parola { font-size: 32px; font-weight: 600; color: var(--bianca); line-height: 1.2; }
.schermo-video .btn { max-width: 300px; }
.schermo-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.schermo-video .etichetta-segno { position: absolute; top: 14px; left: 14px; z-index: 1; background: rgba(20, 22, 26, .78); color: var(--bianca); font-size: 17px; font-weight: 600; padding: 8px 12px; border-radius: 10px; }
.fonte { font-size: 14px; line-height: 1.4; color: var(--testo-2); margin-top: 12px; }
.conta { font-size: 34px; font-weight: 600; line-height: 1.1; color: var(--sai-linea); }
.conta small { font-size: 17px; font-weight: 400; color: var(--testo-2); display: block; margin-top: 6px; }
.barra { height: 14px; border-radius: 7px; background: var(--spento); border: 2px solid var(--testo-2); overflow: hidden; margin: 14px 0 6px; }
.barra i { display: block; height: 100%; background: var(--l2-acc); }
.conf { background: var(--confine); border: 2px solid var(--confine-linea); border-radius: 18px; padding: 18px; margin-bottom: 18px; }
.conf .h { font-size: 24px; font-weight: 700; line-height: 1.25; color: var(--confine-linea); }
.conf .b { font-size: 19px; line-height: 1.45; margin-top: 12px; }
.resta { font-size: 17px; line-height: 1.45; color: var(--testo-2); border-top: 1px solid #D8D4CE; padding-top: 14px; margin-top: 18px; }
.stato-segno { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; padding: 6px 10px; border-radius: 9px; }
.stato-segno.sai { background: var(--sai); color: var(--sai-linea); border: 1.5px solid var(--sai-linea); }
.stato-segno.no { background: var(--spento); color: var(--testo); border: 1.5px solid var(--testo-2); }

/* ---------------------------------------------------------------- impostazioni */
.li { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 0; border-bottom: 1px solid #D8D4CE; min-height: 60px; }
.li .k { font-size: 19px; font-weight: 600; line-height: 1.25; flex: 1; }
.li .k small { display: block; font-size: 14px; font-weight: 400; color: var(--testo-2); margin-top: 3px; }
.li .v { font-size: 17px; color: var(--testo-2); text-align: right; max-width: 45%; line-height: 1.3; }
.li .chev svg { width: 20px; height: 20px; display: block; color: var(--testo-2); }
.li.pericolo .k { color: var(--confine-linea); }
.interruttore { width: 56px; height: 34px; border-radius: 17px; background: var(--spento); border: 2px solid var(--testo-2); position: relative; flex: 0 0 auto; transition: background .15s; }
.interruttore::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--testo-2); transition: transform .15s; }
[aria-checked="true"] > .interruttore { background: var(--l2-acc); border-color: var(--l2-acc); }
[aria-checked="true"] > .interruttore::after { transform: translateX(22px); background: var(--bianca); }
.privacy { font-size: 14px; line-height: 1.45; color: var(--testo-2); margin-top: 22px; }

/* ---------------------------------------------------------------- foglio dal basso */
.velo { position: fixed; inset: 0; background: rgba(20, 22, 26, .5); z-index: 10; animation: entra .15s ease-out; }
.foglio {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 11; background: var(--fondo); border-radius: 24px 24px 0 0;
  padding: 22px 24px calc(env(safe-area-inset-bottom, 0px) + 24px); max-height: 90dvh; overflow: auto;
  animation: sale .2s ease-out;
}
@media (min-width: 560px) { .foglio { max-width: 430px; margin: 0 auto; } }
@keyframes sale { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.foglio .h { font-size: 24px; font-weight: 700; line-height: 1.25; }
.foglio .b { font-size: 17px; line-height: 1.45; margin-top: 10px; color: var(--testo); }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px 16px; border: 2px solid var(--bordo); border-radius: 14px; background: var(--bianca); margin-top: 10px; min-height: 56px; }
.opt .k { flex: 1; font-size: 19px; font-weight: 600; line-height: 1.25; }
.opt .k small { display: block; font-weight: 400; font-size: 14px; color: var(--testo-2); margin-top: 3px; }
.opt[aria-checked="true"] { border-color: var(--l2-acc); background: var(--l2-tenue); }
.opt .ok { width: 22px; height: 22px; color: var(--l2-acc); visibility: hidden; }
.opt[aria-checked="true"] .ok { visibility: visible; }

/* avviso in basso, per un attimo */
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); transform: translateX(-50%); background: var(--testo); color: var(--bianca); font-size: 17px; font-weight: 600; padding: 13px 18px; border-radius: 14px; z-index: 20; max-width: calc(100% - 48px); text-align: center; animation: entra .2s; pointer-events: none; }

/* le icone dentro le righe e le opzioni */
.li > span > svg, .voce .spunta-v svg, .opt .ok svg { width: 22px; height: 22px; display: block; }
.link svg { width: 18px; height: 18px; vertical-align: -3px; }
:focus-visible { outline: 3px solid var(--l2-acc); outline-offset: 3px; }
