/* ChainApp — stile (colori e gradiente di UniCatena, come app/css/01-stile.css del gestionale) */
:root {
    --ink: #15245c; --ink-2: #344369; --muted: #56657f; --muted-2: #6b7890;
    --blue: #2558d4; --blue-dark: #14276f; --pink: #e83179; --orange: #f59c31; --green: #2f8f4e; --violet: #6635bc;
    --line: #e6eaf4; --off: #f6f8fe; --tint-blue: #eaf0ff; --tint-pink: #ffedf4; --tint-orange: #fff3e3; --tint-green: #e8f6ed;
    --danger: #b3261e; --tint-red: #fdecec;
    /* colori ufficiali del logo ChainApp/UniCatena */
    --uc-blu: #223f9e; --uc-azzurro: #2f8ae8; --uc-oro: #e0a526; --uc-azzurro-chiaro: #8ec5f6; --uc-verde: #2fbf5f;
    --grad: linear-gradient(105deg, #2567dc 8%, #6635bc 35%, #ed377a 62%, #f8ac38 88%);
    --radius: 18px; --shadow: 0 10px 35px rgba(11, 31, 110, .07);
    --font: "Plus Jakarta Sans", "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --head: "Plus Jakarta Sans", "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --sicura-su: env(safe-area-inset-top, 0px); --sicura-giu: env(safe-area-inset-bottom, 0px);
    color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--off); font-size: 16px; line-height: 1.45; min-height: 100%; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--blue); }
[hidden] { display: none !important; }
.nascosto-schermo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- intestazione ---------- */
.testata { position: sticky; top: 0; z-index: 5; background: #fff; padding: calc(10px + var(--sicura-su)) 16px 10px; display: flex; align-items: center; gap: 12px; box-shadow: 0 1px 0 var(--line); }
.testata::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: var(--grad); }
.marchio { display: flex; align-items: center; gap: 9px; font-family: var(--head); font-weight: 800; font-size: 19px; color: var(--uc-blu); line-height: 1; }
.marchio img { width: 34px; height: 34px; display: block; }
.marchio small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 3px; }
.testata .chi { margin-left: auto; text-align: right; font-size: 13px; color: var(--muted); line-height: 1.2; }
.testata .chi b { display: block; color: var(--ink); font-size: 14px; }

/* ---------- contenitori ---------- */
.pagina { max-width: 760px; margin: 0 auto; padding: 18px 14px calc(96px + var(--sicura-giu)); }
.scheda { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; border: 1px solid var(--line); }
h1 { font-family: var(--head); font-size: 24px; line-height: 1.2; }
h2 { font-family: var(--head); font-size: 18px; margin-bottom: 10px; }
h3 { font-family: var(--head); font-size: 15px; margin: 14px 0 8px; }
.piccolo { font-size: 13px; color: var(--muted); }
.centro { text-align: center; }
.riga { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- accesso e invito ---------- */
.ingresso { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: calc(20px + var(--sicura-su)) 16px calc(20px + var(--sicura-giu));
    background: radial-gradient(circle at 10% 0%, rgba(37, 103, 220, .14), transparent 45%), radial-gradient(circle at 100% 100%, rgba(237, 55, 122, .12), transparent 45%), var(--off); }
.ingresso .scheda { width: 100%; max-width: 420px; padding: 26px 22px; }
.simbolo { display: block; width: 96px; height: 96px; margin: 0 auto 6px; }
.ingresso h1 { text-align: center; margin: 8px 0 4px; }
.ingresso .sotto { text-align: center; color: var(--muted); margin-bottom: 20px; }
.oppure { display: flex; align-items: center; gap: 10px; color: var(--muted-2); font-size: 13px; margin: 16px 0; }
.oppure::before, .oppure::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- moduli ---------- */
label { display: block; font-weight: 600; font-size: 14px; margin: 10px 0 5px; }
input[type=text], input[type=email], input[type=password], input[type=search], select {
    width: 100%; min-height: 46px; border: 1.5px solid #dbe2f0; border-radius: 12px; padding: 10px 12px; background: #fff; font-size: 16px; }
input:focus, select:focus, button:focus-visible { outline: 3px solid rgba(37, 88, 212, .3); outline-offset: 1px; border-color: var(--blue); }
.bottone { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 999px; border: 0; cursor: pointer;
    font-weight: 700; background: var(--tint-blue); color: var(--blue-dark); text-decoration: none; }
.bottone.primario { background: var(--grad); color: #fff; box-shadow: 0 8px 22px rgba(102, 53, 188, .25); }
.bottone.pieno { width: 100%; }
.bottone.pericolo { background: var(--tint-red); color: var(--danger); }
.bottone.piccolo { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.bottone:disabled { opacity: .55; cursor: default; }
.collegamento { background: none; border: 0; color: var(--blue); cursor: pointer; font-weight: 600; padding: 6px 0; }
.messaggio { border-radius: 12px; padding: 10px 12px; margin: 12px 0 0; font-size: 14px; }
.messaggio.errore { background: var(--tint-red); color: var(--danger); }
.messaggio.ok { background: var(--tint-green); color: #1f6b39; }
.messaggio.info { background: var(--tint-blue); color: var(--blue-dark); }
.regole { font-size: 13px; color: var(--muted); margin: 6px 0 0 18px; }

/* ---------- barra in basso (schede) ---------- */
.schede { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: #fff; border-top: 1px solid var(--line); display: flex; justify-content: center; padding-bottom: var(--sicura-giu); }
.schede button { flex: 1; max-width: 200px; background: none; border: 0; padding: 9px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; color: var(--muted-2); cursor: pointer; }
.schede button svg { width: 24px; height: 24px; }
.schede button[aria-current=page] { color: var(--blue); }
.schede button[aria-current=page] svg { color: var(--pink); }

/* ---------- contatti ---------- */
.avviso-fase { display: flex; gap: 10px; align-items: flex-start; background: var(--tint-orange); color: #7a4706; border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; }
.elenco { list-style: none; }
.elenco li + li { border-top: 1px solid var(--line); }
.contatto { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 6px; background: none; border: 0; text-align: left; cursor: pointer; border-radius: 12px; }
.contatto:hover { background: var(--off); }
.avatar { flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-family: var(--head); }
.contatto .nome { font-weight: 700; display: block; }
.contatto .ruolo { font-size: 13px; color: var(--muted); }
.vuoto { text-align: center; color: var(--muted); padding: 26px 10px; }

/* ---------- conversazione (anteprima Fase 2) ---------- */
.conversazione { position: fixed; inset: 0; z-index: 8; background: #efeae2; display: flex; flex-direction: column; }
.conversazione .testa { background: #fff; display: flex; align-items: center; gap: 10px; padding: calc(8px + var(--sicura-su)) 10px 8px; box-shadow: 0 1px 0 var(--line); }
.conversazione .testa button { background: none; border: 0; padding: 8px; cursor: pointer; color: var(--blue); }
.conversazione .corpo { flex: 1; overflow: auto; padding: 18px 14px; display: flex; flex-direction: column; align-items: center; gap: 12px;
    background-color: #f3f0fa; background-image: radial-gradient(rgba(102, 53, 188, .07) 1px, transparent 1px); background-size: 18px 18px; }
.nuvoletta-sistema { background: #fff8e6; color: #6b4a07; border-radius: 10px; padding: 8px 12px; font-size: 13px; max-width: 420px; text-align: center; box-shadow: 0 1px 1px rgba(0, 0, 0, .06); }
.conversazione .barra { display: flex; gap: 8px; padding: 8px 10px calc(8px + var(--sicura-giu)); background: #f6f6f6; }
.conversazione .barra input { border-radius: 999px; }
.conversazione .barra button { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; opacity: .5; }

/* ---------- pannello ---------- */
.filtri { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.filtri button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 14px; cursor: pointer; }
.filtri button[aria-pressed=true] { border-color: var(--blue); background: var(--tint-blue); color: var(--blue-dark); font-weight: 700; }
.utente { padding: 12px 0; }
.utente + .utente { border-top: 1px solid var(--line); }
.utente .testo { flex: 1; min-width: 180px; }
.utente .azioni { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.bollino { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; margin-left: 4px; vertical-align: 1px; }
.bollino.verde { background: var(--tint-green); color: #1f6b39; }
.bollino.arancio { background: var(--tint-orange); color: #8a5207; }
.bollino.rosso { background: var(--tint-red); color: var(--danger); }
.bollino.blu { background: var(--tint-blue); color: var(--blue-dark); }
.link-invito { display: flex; gap: 8px; margin-top: 10px; }
.link-invito input { font-size: 13px; }
.registro { font-size: 13px; }
.registro li { padding: 6px 0; border-top: 1px solid var(--line); list-style: none; }
details summary { cursor: pointer; font-weight: 700; font-family: var(--head); }

/* ---------- guida installazione ---------- */
.passi { margin: 8px 0 0 20px; }
.passi li { margin: 6px 0; }
.icona-condividi { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; color: var(--blue); }

@media (min-width: 900px) {
    .pagina { padding-top: 26px; }
    .schede { top: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
