/* Font serviti dal nostro server (non da Google Fonts: niente IP degli
   utenti a terzi). Licenza OFL in assets/fonts/. Le URL dei font non hanno
   versione e restano in cache un anno: se un font cambia, cambia nome al file. */

/* Inter, latin-ext */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Inter, latin */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Space Grotesk, latin-ext */
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url('fonts/space-grotesk-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Space Grotesk, latin */
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url('fonts/space-grotesk-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Palette obbligatoria della specifica (§2), usata come nella direzione
   "Contrasto": il blu notte porta tutto, Danube e Perano sono superfici con
   testo blu notte sopra, l'oro compare solo sul blu notte.
   Contrasti misurati: Danube e Hoki come testo su fondo chiaro non arrivano
   a 4,5:1, il bianco su Danube nemmeno, l'oro su chiaro è 2,1:1. */
:root {
    --aqua-spring: #EEF6FA;
    --danube: #648CCB;
    --perano: #A9CDF1;
    --hoki: #6983A2;
    --navy: #171F38;
    --gold: #D4AF37;

    --on-navy-muted: rgba(238, 246, 250, .75);
    --on-light-muted: rgba(23, 31, 56, .7);
    --line-light: rgba(23, 31, 56, .12);
    --glass: rgba(169, 205, 241, .14);

    --gutter: 20px;
    --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    --text: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* Il fondo è blu notte: se si trascina oltre i bordi su iPhone si vede blu,
   non una striscia chiara sopra la testata. */
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--navy);
    color: var(--aqua-spring);
    font-family: var(--text);
    font-size: 16px;
    line-height: 1.5;
}

a { color: inherit; }

/* Testata */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(env(safe-area-inset-top) + 14px) var(--gutter) 0;
}

.logo { display: block; line-height: 0; }
.logo img { height: 46px; width: auto; border-radius: 6px; }

/* Menu delle lingue senza JavaScript: <details> si apre e chiude da solo. */
.lang { position: relative; }
.lang summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border-radius: 22px;
    background: var(--glass);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
}
.lang summary::-webkit-details-marker { display: none; }
.lang ul {
    position: absolute;
    right: 0;
    top: 52px;
    z-index: 10;
    margin: 0;
    padding: 6px;
    list-style: none;
    min-width: 168px;
    background: #fff;
    color: var(--navy);
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(23, 31, 56, .35);
}
.lang a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
}
.lang a:hover { background: var(--aqua-spring); }
.lang a[aria-current] { background: var(--perano); font-weight: 700; }

/* Parte blu: compatta, sotto il 40% dello schermo di un telefono. */

.hero {
    padding: 16px var(--gutter) 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hero-meta {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--perano);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold);
    flex-shrink: 0;
}

.hero-title {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(34px, 10vw, 48px);
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.countdown {
    margin: 4px 0 0;
    font-size: 15px;
    color: var(--on-navy-muted);
}
.countdown-n {
    font-family: var(--display);
    font-size: 40px;
    line-height: 1;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: -0.02em;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--glass);
    font-size: 12px;
    font-weight: 700;
}

/* Pannello chiaro */

.sheet {
    flex: 1;
    background: var(--aqua-spring);
    color: var(--navy);
    border-radius: 32px 32px 0 0;
    padding: 24px var(--gutter) calc(env(safe-area-inset-bottom) + 20px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sheet > * { width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; }

.card {
    background: #fff;
    border-radius: 24px;
    padding: 18px 20px;
}
.card h2 {
    margin: 0;
    font-family: var(--display);
    font-size: 20px;
    line-height: 1.2;
    font-weight: 700;
}
.card p { margin: 6px 0 0; color: var(--on-light-muted); }

.footer {
    margin-top: auto;
    padding-top: 8px;
    font-size: 13px;
    color: var(--on-light-muted);
}
.footer p { margin: 0; }

/* Firma: l'idea è di scc (Sofia), il codice di pcc soft. */
.signature {
    font-family: var(--display);
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
}
.signature-x { color: var(--danube); margin: 0 1px; }

/* Per i lettori di schermo: "scc & pcc soft" invece di "scc per pcc soft". */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Testata: azioni a destra */

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.topbar-link,
.account {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    border-radius: 22px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.topbar-link { padding: 0 16px; background: var(--glass); }
.account { width: 44px; background: var(--gold); color: var(--navy); font-weight: 700; letter-spacing: -0.02em; }

.hero-text { margin: 0; color: var(--on-navy-muted); max-width: 34em; }

/* Moduli */

.form { display: flex; flex-direction: column; gap: 12px; }
.form label { font-weight: 600; }

.code-input {
    width: 100%;
    height: 56px;
    padding: 0 16px;
    border: 2px solid var(--line-light);
    border-radius: 16px;
    background: var(--aqua-spring);
    color: var(--navy);
    font-family: var(--display);
    font-size: 22px; /* sopra i 16px: iOS non fa lo zoom quando si tocca il campo */
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.code-input:focus { outline: none; border-color: var(--navy); }
.code-input::placeholder { color: var(--on-light-muted); letter-spacing: .12em; }

.form-error {
    margin: 0;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--perano);
    color: var(--navy);
    font-weight: 600;
}

.button {
    height: 52px;
    border: 0;
    border-radius: 26px;
    background: var(--navy);
    color: var(--aqua-spring);
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}
.button-quiet { width: 100%; background: transparent; color: var(--navy); border: 2px solid var(--line-light); }

.plain-list { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
code { font-size: 14px; color: var(--on-light-muted); }

@media (min-width: 720px) {
    .topbar, .hero { width: 100%; max-width: 680px; margin-left: auto; margin-right: auto; }
}
