/* ==========================================================================
   CRAL ASMEL — Design system (Fase 0 + Fase 1)
   Base istituzionale asmel.eu + accenti vivaci per il circolo ricreativo.
   Token definiti in PIANO_DI_LAVORO.md §7.

   Font self-hosted (woff2, subset latin) in /assets/fonts/ — nessun CDN
   esterno (GDPR). Titillium Web: 400/600/700/900 · Open Sans: 400/600.
   ========================================================================== */

@font-face {
    font-family: 'Titillium Web';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/Titillium-Web-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Titillium Web';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/assets/fonts/Titillium-Web-600-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Titillium Web';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/Titillium-Web-700-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Titillium Web';
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url('/assets/fonts/Titillium-Web-900-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/Open-Sans-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/assets/fonts/Open-Sans-600-normal.woff2') format('woff2');
}

:root {
    /* Colori */
    --c-primary:      #1C3E90;  /* blu istituzionale: header, footer, titoli */
    --c-primary-dark: #142D6B;
    --c-secondary:    #4F85C5;  /* superfici, hover */
    --c-cta:          #00A3E0;  /* ciano: pulsanti principali, badge sconto */
    --c-coral:        #FF6B4A;  /* corallo: offerte, novità, scadenze */
    --c-emerald:      #10B981;  /* smeraldo: stato socio attivo / verificato */
    --c-bg:           #FFFFFF;
    --c-bg-alt:       #F6F8FB;
    --c-text:         #243044;
    --c-muted:        #5B6B84;

    /* Tipografia */
    --font-head: "Titillium Web", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-body: "Open Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

    /* Forma e ombre */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-soft: 0 6px 24px rgba(28, 62, 144, .10);
    --shadow-lift: 0 10px 30px rgba(28, 62, 144, .16);

    --container: 1120px;
}

/* ---------- Reset minimale ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--c-text);
    background: var(--c-bg);
}
h1, h2, h3, h4 {
    font-family: var(--font-head);
    line-height: 1.2;
    margin: 0 0 .5em;
    color: var(--c-primary);
}
p { margin: 0 0 1em; }
a { color: var(--c-cta); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { padding-left: 1.2em; }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Barra staging ---------- */
.staging-bar {
    background: var(--c-primary-dark);
    color: #C9D6F2;
    font-size: .8rem;
    text-align: center;
    padding: 6px 16px;
    letter-spacing: .03em;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #E4EAF3;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    height: 84px;
}
.logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.logo img {
    /* Scaling fluido: 68px su desktop (richiesta operatori, 29/09),
       scala fino a 44px su schermi stretti (10vw ≈ 44px a 440px) */
    height: clamp(44px, 10vw, 68px);
    width: auto;
    display: block;
}
.logo:hover { text-decoration: none; }

.main-nav { display: flex; gap: 22px; margin-left: auto; }
.main-nav a {
    font-family: var(--font-head);
    font-weight: 600;
    color: var(--c-text);
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
}
.main-nav a:hover { color: var(--c-primary); text-decoration: none; }
.main-nav a.active { color: var(--c-primary); border-bottom-color: var(--c-coral); }

/* ---------- Pulsanti ---------- */
.btn {
    display: inline-block;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: .95rem;
    padding: 12px 26px;
    border-radius: 999px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--c-cta); color: #fff; box-shadow: 0 4px 14px rgba(0, 163, 224, .35); }
.btn-primary:hover { background: #0090C8; }
.btn-ghost {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, .7);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .12); }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-secondary) 100%);
    color: #fff;
    padding: 96px 0 110px;
}
/* Video di sfondo in loop: riempie l'hero, il gradiente resta come fallback. */
.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
/* Velatura scura per mantenere le scritte leggibili sopra il video. */
.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(135deg, rgba(16, 37, 92, .82) 0%, rgba(23, 48, 122, .68) 55%, rgba(16, 37, 92, .78) 100%);
}
.hero-blob { z-index: 1; }
.hero-inner { position: relative; z-index: 2; }
.hero h1 {
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 900;
    color: #fff;
    margin-bottom: .4em;
}
.hero h1 em {
    font-style: normal;
    color: #FFD9CF; /* corallo chiaro sul blu */
}
.hero-kicker {
    display: inline-block;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: .85rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #BFE3F7;
    background: rgba(255, 255, 255, .14);
    border-radius: 999px;
    padding: 6px 16px;
    margin-bottom: 20px;
}
.hero-sub {
    max-width: 560px;
    font-size: 1.1rem;
    color: #DCE7F8;
    margin-bottom: 34px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* Macchie decorative "vivaci" */
.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    opacity: .35;
}
.hero-blob-1 {
    width: 420px; height: 420px;
    right: -120px; top: -140px;
    background: radial-gradient(circle at 30% 30%, var(--c-coral), transparent 70%);
}
.hero-blob-2 {
    width: 360px; height: 360px;
    left: -100px; bottom: -160px;
    background: radial-gradient(circle at 60% 40%, var(--c-cta), transparent 70%);
}

/* ---------- Sezioni ---------- */
.section { padding: 72px 0; }
.section-alt { background: var(--c-bg-alt); }
.section-title { font-size: 1.9rem; font-weight: 900; }
.section-sub { color: var(--c-muted); margin-bottom: 34px; max-width: 620px; }

/* ---------- Categorie ---------- */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
}
.cat-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #E4EAF3;
    border-radius: var(--radius-md);
    padding: 16px 18px;
    font-family: var(--font-head);
    font-weight: 600;
    color: var(--c-text);
    box-shadow: var(--shadow-soft);
    transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.cat-pill:hover {
    text-decoration: none;
    transform: translateY(-3px);
    border-color: var(--c-secondary);
    box-shadow: var(--shadow-lift);
}
.cat-icon { font-size: 1.5rem; }

/* ---------- Notizie (anteprima home) ---------- */
.home-news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.home-news-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #E9EEF6;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    color: inherit;
    transition: transform .14s ease, box-shadow .14s ease;
}
.home-news-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.home-news-img { width: 100%; height: 180px; object-fit: cover; display: block; }
.home-news-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.home-news-body h3 { font-family: var(--font-head); font-size: 1.12rem; color: var(--c-primary); margin: 0; }
.home-news-body p { color: var(--c-muted); font-size: .92rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-empty {
    background: var(--c-bg-alt);
    border: 2px dashed #C9D6EC;
    border-radius: var(--radius-lg);
    padding: 34px;
    text-align: center;
    color: var(--c-muted);
}
.news-empty span { font-size: 2.2rem; display: block; margin-bottom: 10px; }
.news-empty strong { display: block; color: var(--c-primary); font-family: var(--font-head); }

/* ---------- Pagina di errore ---------- */
.error-page { text-align: center; padding: 96px 24px; }
.error-code {
    display: block;
    font-family: var(--font-head);
    font-size: 5rem;
    font-weight: 900;
    color: #DCE7F8;
    line-height: 1;
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--c-primary-dark);
    color: #C9D6F2;
    padding: 56px 0 0;
    margin-top: 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}
.site-footer h3, .site-footer h4 { color: #fff; }
/* Logo ufficiale su chip bianca (il footer è blu scuro) — +30% come l'header */
.footer-logo {
    display: block;
    height: clamp(48px, 10vw, 73px);
    width: auto;
    background: #fff;
    border-radius: 10px;
    padding: 7px 14px;
    margin-bottom: 14px;
}
.footer-brand p { font-size: .95rem; max-width: 320px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 8px; font-size: .95rem; }
.site-footer a { color: #9FC1EE; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .14);
    padding: 18px 24px;
    font-size: .85rem;
    color: #8FA6CE;
}

/* ==========================================================================
   Fase 1 — Componenti sito pubblico (catalogo, dettaglio, notizie, auth)
   ========================================================================== */

/* ---------- Banda titolo pagina ---------- */
.page-head {
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-secondary) 100%);
    color: #fff;
    padding: 52px 0 56px;
}
.page-head h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 2.7rem); margin-bottom: .3em; }
.page-head p { color: #DCE7F8; max-width: 640px; margin-bottom: 0; }

.search-form { display: flex; gap: 10px; margin-top: 24px; max-width: 560px; }
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 13px 20px;
    border: none;
    border-radius: 999px;
    font-size: .95rem;
    color: var(--c-text);
    background: #fff;
}
.search-form input[type="search"]:focus { outline: 3px solid rgba(255, 255, 255, .45); }

/* ---------- Sezioni compatte / intestazioni a riga ---------- */
.section-tight { padding-top: 40px; padding-bottom: 48px; }
.section-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}
.section-head-row .section-sub { margin-bottom: 0; }

/* ---------- Pillole filtro categoria ---------- */
.filter-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 999px;
    background: #fff;
    border: 1.5px solid #DCE5F2;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: .88rem;
    color: var(--c-text);
    box-shadow: var(--shadow-soft);
    transition: transform .12s ease, border-color .12s ease;
}
.pill:hover { text-decoration: none; border-color: var(--c-secondary); transform: translateY(-1px); }
.pill-active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.pill-count {
    font-size: .75rem;
    font-weight: 700;
    background: #EDF2FA;
    color: var(--c-primary);
    border-radius: 999px;
    padding: 2px 8px;
}
.pill-active .pill-count { background: rgba(255, 255, 255, .22); color: #fff; }

/* ---------- Griglia e card convenzioni ---------- */
.conv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
}
.conv-card {
    display: block;
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid #E9EEF6;
    color: inherit;
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.conv-card:hover {
    text-decoration: none;
    transform: translateY(-4px);
    box-shadow: var(--shadow-lift);
    border-color: #CFE0F5;
}
.conv-cover {
    position: relative;
    height: 168px;
    background: #fff;
    overflow: hidden;
}
/* object-fit: contain → l'immagine di copertina è sempre intera (ridimensionata
   per adattarsi), con barre bianche dove il formato non coincide. */
.conv-cover img { width: 100%; height: 100%; object-fit: contain; display: block; }
.conv-cover-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--c-primary), var(--c-secondary));
    font-family: var(--font-head);
    font-weight: 900;
    font-size: 3.4rem;
    color: rgba(255, 255, 255, .92);
}
.conv-cover .badge-lock { position: absolute; top: 12px; right: 12px; box-shadow: var(--shadow-soft); }
.conv-body { padding: 18px 20px 22px; }
.conv-body h3 { font-size: 1.15rem; margin-bottom: .25em; }
.conv-body p {
    color: var(--c-muted);
    font-size: .93rem;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Badge ---------- */
.badges-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 13px;
    border-radius: 999px;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: .78rem;
    letter-spacing: .02em;
}
.badge-category { background: #EAF2FD; color: var(--c-primary); }
.badge-lock     { background: #FFEDE7; color: #D14A26; }
.badge-expiry   { background: #E5F7F0; color: #0B7A5C; }
.badge-tag      { background: #E3F4FC; color: #00719E; }

/* ---------- Fase 4.5 — convenzioni locali e filtro geografico ---------- */
/* Badge zona (📍): emerald pieno per dare evidenza alla novità, distinto dai badge pastello */
.badge-zone { background: var(--c-emerald); color: #fff; }

/* Home — sezione "Vicino a te": tinta smeraldo leggera per distinguersi dalle sezioni bianche/grigie */
.section-near {
    background: linear-gradient(180deg, #EFF9F4 0%, #F7FBF9 100%);
    border-top: 1px solid #DCEEE5;
    border-bottom: 1px solid #E2EFE8;
}

/* Card-invito per ospiti / soci senza posizione nota */
.near-invite {
    max-width: 640px;
    margin: 0 auto;
    background: #fff;
    border: 1.5px solid #CDEBDD;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 38px 34px;
    text-align: center;
}
.near-invite-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #E5F7F0;
    font-size: 1.8rem;
    margin-bottom: 14px;
}
.near-invite h2 { font-size: 1.45rem; margin-bottom: .3em; }
.near-invite p { color: var(--c-muted); max-width: 460px; margin: 0 auto 22px; }
.near-invite-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.near-invite-form select {
    min-width: 250px;
    padding: 12px 14px;
    border: 1.5px solid #D5DEEC;
    border-radius: var(--radius-sm);
    font-size: .98rem;
    color: var(--c-text);
    background: #FBFCFE;
}
.near-invite-form select:focus {
    outline: none;
    border-color: var(--c-emerald);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .18);
}

/* Catalogo — nota della vista filtrata per zona */
.zone-view-note {
    background: #E3F4FC;
    color: #00618C;
    border: 1px solid #BFE6F7;
    border-left: 4px solid var(--c-cta);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 22px;
    font-size: .95rem;
}
.zone-view-note a { color: inherit; text-decoration: underline; }

/* Catalogo — filtro Zona (combinabile con categoria e ricerca) */
.zone-filter-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}
.zone-filter-form label {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: .9rem;
    color: var(--c-text);
}
.zone-filter-form select {
    min-width: 270px;
    padding: 10px 14px;
    border: 1.5px solid #D5DEEC;
    border-radius: var(--radius-sm);
    font-size: .95rem;
    color: var(--c-text);
    background: #FBFCFE;
}
.zone-filter-form select:focus {
    outline: none;
    border-color: var(--c-cta);
    box-shadow: 0 0 0 3px rgba(0, 163, 224, .18);
}

/* Dettaglio — pannello "Dove si usa" (solo convenzioni locali) */
.where-panel {
    background: linear-gradient(135deg, #F2FBF7, #FFFFFF);
    border: 1.5px solid #CDEBDD;
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 30px;
}
.where-panel h2 { font-size: 1.3rem; margin-bottom: 6px; }
.zone-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 0;
    margin: 14px 0 0;
}
.zone-list li { display: inline-flex; align-items: center; gap: 8px; }

@media (max-width: 640px) {
    .near-invite { padding: 28px 20px; }
    .near-invite-form select, .zone-filter-form select { min-width: 100%; width: 100%; }
}

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: .86rem; color: var(--c-muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--c-cta); }

/* ---------- Dettaglio convenzione ---------- */
.conv-head { display: flex; gap: 22px; align-items: flex-start; margin-bottom: 26px; }
.conv-logo {
    width: 76px;
    height: 76px;
    object-fit: contain;
    background: #fff;
    border-radius: var(--radius-md);
    padding: 10px;
    box-shadow: var(--shadow-soft);
    flex-shrink: 0;
}
.conv-head h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: .2em; }
.conv-subtitle { color: var(--c-muted); font-size: 1.05rem; margin-bottom: 12px; }
.conv-cover-full {
    width: 100%;
    max-height: 430px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
    display: block;
}

/* ---------- Prosa (contenuti curati da admin/redazione) ---------- */
.prose { line-height: 1.75; font-size: .98rem; }
.prose h2 { font-size: 1.45rem; margin-top: 1.6em; }
.prose h3 { font-size: 1.15rem; margin-top: 1.4em; }
.prose a { color: var(--c-cta); text-decoration: underline; text-underline-offset: 2px; }
.prose ul, .prose ol { margin-bottom: 1em; }
.prose img { max-width: 100%; border-radius: var(--radius-md); }
.prose-box {
    background: var(--c-bg-alt);
    border-left: 4px solid var(--c-secondary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 20px 24px;
    margin-top: 10px;
}

.article h1 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); }
.meta-line { color: var(--c-muted); font-size: .9rem; margin-bottom: 18px; }
.article-image {
    width: 100%;
    max-height: 430px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: 26px;
    display: block;
}

/* ---------- Pannello codici sconto ---------- */
.coupon-panel {
    background: linear-gradient(135deg, #FFF8F5, #FFFFFF);
    border: 1.5px solid #FFE0D4;
    border-radius: var(--radius-lg);
    padding: 30px 28px;
    margin-top: 40px;
}
.coupon-panel h2 { font-size: 1.35rem; margin-bottom: 18px; }
.coupon-box {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 1px solid #E4EAF3;
    border-radius: var(--radius-md);
    padding: 20px 22px;
    margin-bottom: 16px;
}
.coupon-box > span { font-size: 1.9rem; flex-shrink: 0; }
.coupon-box p { margin: 0 0 4px; }
.coupon-box small { color: var(--c-muted); display: block; }

.coupon-code {
    border: 2px dashed var(--c-coral);
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    text-align: center;
}
.code-row { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.discount-code {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 1.35rem;
    letter-spacing: .08em;
    font-weight: 700;
    color: var(--c-primary-dark);
    background: #F4F7FB;
    border: 1px solid #DCE5F2;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    user-select: all;
    word-break: break-all;
}
.copy-btn { padding: 9px 20px; font-size: .88rem; }
.copy-btn.copied { background: var(--c-emerald); box-shadow: 0 4px 14px rgba(16, 185, 129, .35); }

.partner-cta { margin-top: 8px; }
.partner-contacts { margin-top: 26px; color: var(--c-muted); font-size: .95rem; }
.partner-contacts strong { color: var(--c-text); }

/* ---------- Notizie (lista e dettaglio) ---------- */
.news-list { display: flex; flex-direction: column; gap: 18px; }
.news-card {
    display: flex;
    gap: 20px;
    align-items: center;
    background: #fff;
    border: 1px solid #E9EEF6;
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-soft);
    color: inherit;
    transition: transform .14s ease, box-shadow .14s ease;
}
.news-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.news-card img { width: 200px; height: 140px; object-fit: cover; border-radius: var(--radius-md); flex-shrink: 0; }
.news-card-body h2 { font-size: 1.18rem; margin-bottom: .3em; }
.news-card-body p {
    color: var(--c-muted);
    font-size: .93rem;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-date { color: var(--c-muted); font-size: .84rem; font-weight: 600; }

/* ---------- Stati vuoti ---------- */
.empty-state {
    text-align: center;
    padding: 56px 28px;
    background: var(--c-bg-alt);
    border: 2px dashed #C9D6EC;
    border-radius: var(--radius-lg);
}
.empty-state span { font-size: 2.4rem; display: block; margin-bottom: 12px; }
.empty-state strong {
    display: block;
    font-family: var(--font-head);
    color: var(--c-primary);
    font-size: 1.15rem;
    margin-bottom: 8px;
}
.empty-state p { color: var(--c-muted); max-width: 440px; margin: 0 auto; }
.empty-note { color: var(--c-muted); }

/* ---------- Convenzione riservata (locked) ---------- */
.locked-panel {
    text-align: center;
    padding: 72px 32px;
    background: var(--c-bg-alt);
    border-radius: var(--radius-lg);
    margin-top: 8px;
}
.locked-icon { font-size: 3rem; display: block; margin-bottom: 16px; }
.locked-panel h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
.locked-panel p { color: var(--c-muted); max-width: 480px; margin: 0 auto 26px; }

/* ---------- Auth (login / recupero password) ---------- */
.auth-wrap { max-width: 470px; }
.auth-card {
    background: #fff;
    border: 1px solid #E9EEF6;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lift);
    padding: 38px 34px;
}
.auth-logo {
    display: block;
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: .25em; }
.auth-sub { color: var(--c-muted); margin-bottom: 22px; }
.auth-card label {
    display: block;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: .9rem;
    margin: 18px 0 7px;
}
.auth-card input[type="email"],
.auth-card input[type="password"] {
    width: 100%;
    padding: 13px 15px;
    border: 1.5px solid #D5DEEC;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--c-text);
    background: #FBFCFE;
}
.auth-card input:focus {
    outline: none;
    border-color: var(--c-cta);
    box-shadow: 0 0 0 3px rgba(0, 163, 224, .18);
}
.btn-block { display: block; width: 100%; margin-top: 26px; }
.auth-link { display: inline-block; margin-top: 20px; font-size: .95rem; }

.reset-link {
    background: #F4F7FB;
    border: 1px solid #DCE5F2;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-top: 10px;
    word-break: break-all;
    font-size: .9rem;
}
.reset-link a { color: var(--c-cta); text-decoration: underline; }

/* ---------- Alert / flash ---------- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: .95rem;
}
.alert a { color: inherit; text-decoration: underline; }
.alert-success { background: #E7F8F1; color: #0B6B4F; border-color: #BFEAD9; }
.alert-error   { background: #FFEBE7; color: #A93B20; border-color: #FFD2C5; }
.alert-info    { background: #E3F4FC; color: #00618C; border-color: #BFE6F7; }
.alert-warning { background: #FFF6E5; color: #8A5A00; border-color: #FFE3AC; }

.container-narrow-top { max-width: 760px; margin-top: 24px; }
.container-narrow { max-width: 860px; }

/* ---------- Header: utente loggato ---------- */
.user-box { display: flex; align-items: center; gap: 14px; }
.user-hello {
    font-family: var(--font-head);
    font-weight: 600;
    color: var(--c-primary);
    font-size: .95rem;
    white-space: nowrap;
}
.inline-form { display: inline-flex; align-items: center; margin: 0; }

/* ---------- Pulsanti outline ---------- */
.btn-outline { background: transparent; border-color: var(--c-primary); color: var(--c-primary); }
.btn-outline:hover { background: rgba(28, 62, 144, .07); }
.btn-outline-sm { padding: 8px 18px; font-size: .85rem; }

/* ==========================================================================
   Fase 2 — Area socio (dashboard, profilo, tessera digitale, codici)
   ========================================================================== */

/* ---------- Badge stato socio ---------- */
.badge-status-active    { background: #E5F7F0; color: #0B7A5C; }
.badge-status-pending   { background: #EAF2FD; color: var(--c-primary); }
.badge-status-suspended { background: #FFEDE7; color: #D14A26; }

/* ---------- Dashboard area socio ---------- */
.area-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 44px;
}
.dash-card {
    display: block;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 26px 26px 22px;
    box-shadow: var(--shadow-soft);
    border-top: 5px solid transparent;
    color: inherit;
    transition: transform .14s ease, box-shadow .14s ease;
}
.dash-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.dash-card-emerald { border-top-color: var(--c-emerald); }
.dash-card-coral   { border-top-color: var(--c-coral); }
.dash-card-cyan    { border-top-color: var(--c-cta); }
.dash-icon { font-size: 1.9rem; display: block; margin-bottom: 12px; }
.dash-card h3 { font-size: 1.15rem; margin-bottom: .3em; }
.dash-value {
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--c-primary-dark);
    font-size: 1.05rem;
    margin: 0 0 4px;
}
.dash-card small { color: var(--c-muted); display: block; }
.dash-cta {
    display: inline-block;
    margin-top: 14px;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: .9rem;
    color: var(--c-cta);
}
.dash-hint {
    display: inline-block;
    margin-top: 8px;
    background: #FFF6E5;
    border: 1px solid #FFE3AC;
    color: #8A5A00;
    font-size: .8rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 4px 12px;
}
.area-subtitle { margin-bottom: 18px; }

/* ---------- Tessera digitale (anteprima live) ---------- */
.tessera-preview {
    background: linear-gradient(135deg, var(--c-primary) 0%, #2A54B8 60%, var(--c-secondary) 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lift);
    overflow: hidden;
    color: #fff;
}
.tessera-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(0, 0, 0, .18);
    padding: 14px 26px;
}
.tessera-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-head);
    font-weight: 900;
    font-size: 1.35rem;
    letter-spacing: .04em;
}
.tessera-icon {
    width: 27px;
    height: 27px;
    background: #fff;
    border-radius: 6px;
    padding: 2px;
    flex-shrink: 0;
}
.tessera-brand span { color: #FFB4A2; }
.tessera-kind {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: .8rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #C9D6F2;
}
.tessera-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 30px 26px 34px;
}
.tessera-name {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0 0 18px;
}
.tessera-label {
    font-size: .72rem;
    letter-spacing: .14em;
    color: #B9C9E8;
    margin: 0 0 2px;
}
.tessera-number {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: .06em;
    margin: 0 0 14px;
}
.tessera-validity { color: #C9D6F2; font-size: .95rem; margin: 0; }
.tessera-qr-box {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 14px 14px 8px;
    text-align: center;
    flex-shrink: 0;
}
.tessera-qr-box img { display: block; width: 150px; height: 150px; }
.tessera-qr-box small { color: var(--c-muted); font-size: .72rem; display: block; margin-top: 4px; }

.tessera-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin: 26px 0 30px;
}
.tessera-info-box { margin-top: 0; }
.tessera-info-box h3 { font-size: 1.1rem; margin-bottom: .5em; }

/* ---------- Profilo (form) ---------- */
.profile-card {
    background: #fff;
    border: 1px solid #E9EEF6;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 32px 30px;
    margin-bottom: 28px;
}
.profile-card h2 { font-size: 1.3rem; margin-bottom: 6px; }
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 22px;
}
.form-grid label {
    display: block;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: .9rem;
    margin-top: 16px;
    color: var(--c-text);
}
.form-grid input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #D5DEEC;
    border-radius: var(--radius-sm);
    font-size: .98rem;
    color: var(--c-text);
    background: #FBFCFE;
}
.form-grid input:focus {
    outline: none;
    border-color: var(--c-cta);
    box-shadow: 0 0 0 3px rgba(0, 163, 224, .18);
}
.form-grid input:disabled { background: #EEF2F8; color: var(--c-muted); }
/* Fase 4.5 — select (provincia autodichiarata in profilo): stesso stile degli input */
.form-grid select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #D5DEEC;
    border-radius: var(--radius-sm);
    font-size: .98rem;
    color: var(--c-text);
    background: #FBFCFE;
}
.form-grid select:focus {
    outline: none;
    border-color: var(--c-cta);
    box-shadow: 0 0 0 3px rgba(0, 163, 224, .18);
}
.form-grid-single { grid-template-columns: 1fr; max-width: 420px; }
.form-note {
    color: var(--c-muted);
    font-size: .85rem;
    background: var(--c-bg-alt);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin: 18px 0 24px;
}

/* ---------- Codici (lista) ---------- */
.codes-list {
    list-style: none;
    margin: 0 0 30px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.code-item {
    background: #fff;
    border: 1px solid #E9EEF6;
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: var(--shadow-soft);
}
.code-partner a { font-family: var(--font-head); font-weight: 700; color: var(--c-primary); }
.code-partner small { display: block; color: var(--c-muted); margin-top: 2px; }
.code-item .code-row { justify-content: flex-start; margin-top: 12px; }
.discount-code-sm { font-size: 1.05rem; padding: 7px 14px; }
.copy-btn-sm { padding: 7px 16px; font-size: .82rem; }
.code-expiry { color: var(--c-muted); display: block; margin-top: 10px; font-size: .85rem; }
.code-expired { opacity: .65; border-style: dashed; }

/* ---------- Contenuto coupon box (codici monouso) ---------- */
.coupon-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

/* ---------- Verifica tessera (pagina esercente) ---------- */
.verify-panel {
    text-align: center;
    padding: 64px 32px;
    border-radius: var(--radius-lg);
}
.verify-valid   { background: #E7F8F1; border: 2px solid #BFEAD9; }
.verify-invalid { background: #FFEBE7; border: 2px solid #FFD2C5; }
.verify-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    font-size: 1.9rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 18px;
}
.verify-valid .verify-icon   { background: var(--c-emerald); }
.verify-invalid .verify-icon { background: var(--c-coral); }
.verify-panel h1 {
    font-size: clamp(1.6rem, 4vw, 2.3rem);
    margin-bottom: .3em;
}
.verify-valid h1   { color: #0B7A5C; }
.verify-invalid h1 { color: #A93B20; }
.verify-name {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--c-primary-dark);
    margin: 0 0 8px;
}
.verify-meta { color: var(--c-muted); font-size: .92rem; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 14px; }
    .main-nav { order: 3; width: 100%; margin-left: 0; justify-content: center; flex-wrap: wrap; gap: 16px; }
    .hero { padding: 64px 0 72px; }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }

    /* Fase 2 */
    .tessera-body { flex-direction: column; align-items: stretch; }
    .tessera-qr-box { margin: 0 auto; width: fit-content; }
    .form-grid { grid-template-columns: 1fr; }

    /* Fase 1 */
    .page-head { padding: 40px 0 44px; }
    .conv-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
    .home-news-grid { grid-template-columns: repeat(2, 1fr); }
    .news-card { flex-direction: column; align-items: stretch; }
    .news-card img { width: 100%; height: 180px; }
    .conv-head { flex-wrap: wrap; }
    .auth-card { padding: 28px 22px; }
    .coupon-panel { padding: 24px 20px; }
}

@media (max-width: 600px) {
    .home-news-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Animazioni — eleganti e non invasive (aggiunte post-Fase 3)
   Principi: solo transform/opacity (GPU, zero layout shift); il contenuto è
   sempre visibile senza JavaScript o con prefers-reduced-motion; il pannello
   admin resta statico (velocità per gli operatori).
   ========================================================================== */

/* --- Reveal on scroll (attivate da app.js: classe .cral-js su <html>) --- */
.cral-js .reveal { opacity: 0; }
.cral-js .reveal.is-visible {
    animation: cral-reveal .6s cubic-bezier(.22, .61, .36, 1) both;
    animation-delay: var(--rd, 0ms);
}
/* A fine animazione app.js sostituisce la classe con is-shown (senza fill-mode):
   i transform di hover delle card tornano a funzionare normalmente */
.cral-js .reveal.is-shown { animation: none; opacity: 1; }

@keyframes cral-reveal {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}

/* --- Hero: ingresso scaglionato al caricamento (CSS puro, senza JS) --- */
.hero-inner > * { animation: cral-hero-in .7s cubic-bezier(.22, .61, .36, 1) both; }
.hero-inner > *:nth-child(1) { animation-delay: .05s; }
.hero-inner > *:nth-child(2) { animation-delay: .14s; }
.hero-inner > *:nth-child(3) { animation-delay: .23s; }
.hero-inner > *:nth-child(4) { animation-delay: .32s; }

@keyframes cral-hero-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}

/* Blob decorativi dell'hero: deriva lenta (vivacità senza distrazione) */
.hero-blob-1 { animation: cral-blob-drift-a 18s ease-in-out infinite alternate; }
.hero-blob-2 { animation: cral-blob-drift-b 22s ease-in-out -9s infinite alternate; }

@keyframes cral-blob-drift-a {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(-46px, 34px, 0) scale(1.12); }
}
@keyframes cral-blob-drift-b {
    from { transform: translate3d(0, 0, 0) scale(1.08); }
    to   { transform: translate3d(40px, -28px, 0) scale(.96); }
}

/* --- Nav: transizione morbida di colore e sottolineatura (border già presente) --- */
.main-nav a { transition: color .2s ease, border-color .25s ease; }
.main-nav a:hover { border-bottom-color: rgba(255, 107, 74, .4); }

/* --- Card: pop icona (categorie) ---
   (zoom copertina rimosso: con object-fit: contain lo scalamento al hover
    taglierebbe i bordi dell'immagine, che deve restare sempre intera) */
.cat-pill .cat-icon { display: inline-block; transition: transform .25s ease; }
.cat-pill:hover .cat-icon { transform: scale(1.18) rotate(-6deg); }

/* --- Pulsanti: transizione morbida, pressione tattile, ombra al hover primario --- */
.btn {
    transition: transform .15s ease, box-shadow .2s ease,
                background-color .2s ease, border-color .2s ease;
}
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(0, 163, 224, .45); }

/* --- Micro-interazioni: ingresso alert + pop "Copiato!" --- */
.alert { animation: cral-alert-in .4s ease both; }
@keyframes cral-alert-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: none; }
}

.copy-btn.copied { animation: cral-pop .35s ease; }
@keyframes cral-pop {
    40% { transform: scale(1.07); }
}

/* --- Accessibilità: niente movimento per chi preferisce reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .cral-js .reveal { opacity: 1; transform: none; animation: none; }
}
