﻿/* ==========================================================================
   event-landing.css
   Pagina pubblica di iscrizione a un evento (/e/{slug}).
   Non eredita il layout dell'applicazione: è una pagina a sé, vista da chi
   non ha un account. I quattro temi sono preset completi scelti
   dall'organizzatore; --accent è l'unico colore che imposta a mano.
   ========================================================================== */

:root {
    --accent: #7c6fd6;
    --lp-bg: #f6f7fb;
    --lp-surface: #ffffff;
    --lp-text: #23212e;
    --lp-muted: #6b6980;
    --lp-border: #e6e4ef;
    --lp-radius: 16px;
    --lp-font: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --lp-heading-font: var(--lp-font);
    --lp-hero-bg: #1e293b;
    --lp-hero-text: #ffffff;
}

/* ── Tema scuro ────────────────────────────────────────────── */
[data-theme="scuro"] {
    --lp-bg: #0f172a;
    --lp-surface: #1b2438;
    --lp-text: #e8eaf2;
    --lp-muted: #9aa3b8;
    --lp-border: #2a3550;
    --lp-hero-bg: #0b1120;
}

/* ── Tema elegante: serif e toni caldi ─────────────────────── */
[data-theme="elegante"] {
    --lp-bg: #f7f4ee;
    --lp-surface: #fffdf8;
    --lp-text: #2c2a26;
    --lp-muted: #6f6a5f;
    --lp-border: #e4ddcd;
    --lp-radius: 6px;
    --lp-heading-font: Georgia, 'Times New Roman', serif;
    --lp-hero-bg: #2c2a26;
}

/* ── Tema vivace: copertina a gradiente sull'accento ───────── */
[data-theme="vivace"] {
    --lp-bg: #ffffff;
    --lp-radius: 22px;
}

/* ── Base ──────────────────────────────────────────────────── */
/* Campi e pulsante del modulo sono width:100% con padding e bordo: senza
   border-box uscirebbero dalla scheda e la parte destra risulterebbe tagliata. */
body.lp,
body.lp *,
body.lp *::before,
body.lp *::after {
    box-sizing: border-box;
}

body.lp {
    margin: 0;
    background: var(--lp-bg);
    color: var(--lp-text);
    font-family: var(--lp-font);
    line-height: 1.55;
}

    body.lp h1, body.lp h2, body.lp h3 {
        font-family: var(--lp-heading-font);
        letter-spacing: -.01em;
    }

/* Il corpo sale di 36px sopra la copertina: siccome la copertina e' un
   elemento posizionato, senza questo z-index si prenderebbe il disegno
   sopra le schede e ne nasconderebbe il bordo superiore. */
.lp-wrap {
    position: relative;
    z-index: 1;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px 64px;
}

/* ── Avviso di anteprima ───────────────────────────────────── */
.lp-preview {
    background: #fef3c7;
    color: #92400e;
    text-align: center;
    padding: 10px 16px;
    font-size: .88rem;
    font-weight: 600;
}

/* ── Copertina ─────────────────────────────────────────────── */
.lp-hero {
    position: relative;
    z-index: 0;
    background: var(--lp-hero-bg);
    color: var(--lp-hero-text);
    padding: 72px 20px;
    text-align: center;
    background-size: cover;
    background-position: center;
}

[data-theme="vivace"] .lp-hero {
    background-image: linear-gradient(135deg, var(--accent) 0%, #0f172a 130%);
}

/* ── Copertina a tutta pagina ──────────────────────────────────
   La foto non sta piu' chiusa nella fascia del titolo (che la tagliava a
   striscia): occupa tutta la parte alta, passa dietro le schede e sfuma
   nello sfondo della pagina. Il punto da tenere in vista lo sceglie
   l'organizzatore trascinandola nell'editor (background-position inline). */
body.lp {
    position: relative;
}

.lp-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: max(560px, 92vh);
    z-index: 0;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 42%, rgba(0,0,0,.55) 70%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, #000 42%, rgba(0,0,0,.55) 70%, transparent 100%);
}

    /* Velo scuro in alto, dove stanno titolo e date: su un'immagine chiara
       il testo bianco altrimenti non si legge. Sotto si apre del tutto. */
    .lp-backdrop::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(15,23,42,.30) 0%, rgba(15,23,42,.42) 38%, rgba(15,23,42,.10) 65%, transparent 100%);
    }

.lp-hero.has-cover {
    background: transparent;
    min-height: clamp(300px, 48vh, 560px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 64px 20px 76px;
}

    .lp-hero.has-cover .lp-hero-inner {
        width: 100%;
    }

    .lp-hero.has-cover h1,
    .lp-hero.has-cover p.lp-sub {
        text-shadow: 0 2px 18px rgba(15,23,42,.55);
    }

    .lp-hero.has-cover .lp-chip {
        background: rgba(15,23,42,.38);
    }

/* Titolo nascosto: la copertina lo porta gia' scritto. Senza titolo la
   fascia senza foto si accorcia, con la foto resta alta per mostrarla. */
.lp-hero.no-title:not(.has-cover) {
    padding: 48px 20px 64px;
}

.lp-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.lp-preview {
    position: relative;
    z-index: 2;
}

.lp-hero-inner {
    position: relative;
    max-width: 820px;
    margin: 0 auto;
}

.lp-logo {
    max-height: 64px;
    max-width: 220px;
    margin-bottom: 20px;
}

.lp-hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.9rem);
    font-weight: 800;
    margin: 0 0 12px;
    color: #fff;
}

.lp-hero p.lp-sub {
    font-size: 1.05rem;
    opacity: .9;
    margin: 0 0 22px;
}

.lp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.lp-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: .86rem;
    backdrop-filter: blur(4px);
}

/* ── Corpo a due colonne ───────────────────────────────────── */
.lp-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 28px;
    margin-top: -36px;
}

@media (max-width: 900px) {
    .lp-grid {
        grid-template-columns: 1fr;
        margin-top: 24px;
    }
}

.lp-card {
    background: var(--lp-surface);
    border: 1px solid var(--lp-border);
    border-radius: var(--lp-radius);
    padding: 24px 26px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px -18px rgba(15,23,42,.35);
}

    .lp-card h2 {
        font-size: 1.15rem;
        font-weight: 700;
        margin: 0 0 16px;
        display: flex;
        align-items: center;
        gap: 9px;
    }

        .lp-card h2 i {
            color: var(--accent);
        }

.lp-intro {
    white-space: pre-line;
    color: var(--lp-text);
}

/* ── Programma ─────────────────────────────────────────────── */
.lp-agenda {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lp-agenda-item {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--lp-border);
}

    .lp-agenda-item:last-child {
        border-bottom: 0;
    }

.lp-agenda-time {
    font-weight: 700;
    color: var(--accent);
    font-size: .92rem;
}

.lp-agenda-title {
    font-weight: 600;
}

.lp-agenda-desc {
    color: var(--lp-muted);
    font-size: .9rem;
}

/* ── Relatori ──────────────────────────────────────────────── */
.lp-speakers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}

.lp-speaker {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.lp-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex: 0 0 auto;
}

.lp-speaker-name {
    font-weight: 600;
}

.lp-speaker-role {
    color: var(--lp-muted);
    font-size: .85rem;
}

/* ── Modulo di iscrizione ──────────────────────────────────── */
/* Il modulo segue la lettura del programma restando a fianco, ma solo se ci
   sta: appiccicato in alto su una finestra bassa, il fondo (consenso e
   pulsante di invio) finisce fuori schermo e non si raggiunge piu'. */
.lp-form-card {
    position: static;
    max-height: none;
}

@media (min-height: 860px) {
    .lp-form-card {
        position: sticky;
        top: 20px;
        /* Modulo con molti campi anche su schermo alto: scorre dentro
           di se' invece di uscire dalla finestra. */
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        overflow-x: hidden;
    }
}

/* Nome e cognome affiancati; sotto i 560px tornano uno sopra l'altro. */
.lp-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px
}

@media (max-width: 560px) {
    .lp-field-row {
        grid-template-columns: 1fr
    }
}

.lp-field {
    margin-bottom: 14px;
}

    .lp-field label {
        display: block;
        font-size: .85rem;
        font-weight: 600;
        margin-bottom: 5px;
        color: var(--lp-muted);
    }

    .lp-field textarea {
        resize: vertical;
    }

    .lp-field input[type=text],
    .lp-field input[type=email],
    .lp-field input[type=tel],
    .lp-field input[type=number],
    .lp-field input[type=date],
    .lp-field select,
    .lp-field textarea {
        width: 100%;
        max-width: 100%;
        background: var(--lp-bg);
        border: 1px solid var(--lp-border);
        border-radius: 10px;
        padding: 11px 13px;
        color: var(--lp-text);
        font-family: inherit;
        font-size: .95rem;
    }

        .lp-field input:focus,
        .lp-field select:focus,
        .lp-field textarea:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
        }

/* Scelte fra opzioni: incolonnate, con tutta la riga cliccabile. */
.lp-choices {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.lp-choice {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    font-size: .9rem;
    color: var(--lp-text);
    cursor: pointer;
}

    .lp-choice input {
        margin-top: 2px;
        accent-color: var(--accent);
        flex: 0 0 auto;
    }

/* Riga di aiuto sotto al campo, per le istruzioni dell'organizzatore. */
.lp-help {
    display: block;
    font-size: .8rem;
    color: var(--lp-muted);
    margin-top: 4px;
}

.lp-required {
    color: #dc2626;
}

.lp-consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: .85rem;
    color: var(--lp-muted);
    margin-bottom: 16px;
}

.lp-btn {
    display: block;
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 12px;
    padding: 13px 18px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter .15s ease, transform .15s ease;
}

    .lp-btn:hover {
        filter: brightness(1.07);
        transform: translateY(-1px);
    }

.lp-seats {
    text-align: center;
    font-size: .85rem;
    color: var(--lp-muted);
    margin-top: 12px;
}

.lp-notice {
    border-radius: 12px;
    padding: 13px 15px;
    font-size: .9rem;
    margin-bottom: 16px;
}

.lp-notice-warn {
    background: color-mix(in srgb, #f59e0b 16%, transparent);
    color: #92400e;
}

.lp-notice-error {
    background: color-mix(in srgb, #dc2626 12%, transparent);
    color: #991b1b;
}

.lp-error {
    color: #dc2626;
    font-size: .82rem;
    margin-top: 4px;
    display: block;
}

/* Esca anti-bot: fuori dallo schermo, mai vista da chi compila. */
.lp-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ── Chiusura / ringraziamento ─────────────────────────────── */
.lp-closed,
.lp-thanks {
    text-align: center;
    padding: 22px 10px;
}

    .lp-thanks .lp-check {
        width: 64px;
        height: 64px;
        border-radius: 50%;
        background: color-mix(in srgb, var(--accent) 18%, transparent);
        color: var(--accent);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.9rem;
        margin-bottom: 16px;
    }

.lp-footer {
    text-align: center;
    color: var(--lp-muted);
    font-size: .8rem;
    padding: 28px 20px 0;
}

/* Il blocco "dove" con l'indirizzo. */
.lp-place {
    color: var(--lp-muted);
    font-size: .93rem;
}

    .lp-place strong {
        color: var(--lp-text);
        display: block;
        font-size: 1rem;
    }

/* Collegamento alla mappa sotto l'indirizzo. */
.lp-map {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    color: var(--accent);
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
}

    .lp-map:hover {
        text-decoration: underline;
    }
