/* ================================================================
   E20 Public — Frontend Socio
   Prefisso: e20-
   Caricato in canvas.blade.php dopo custom.css
   ================================================================ */

/* ---- Custom Properties (override per tema tenant) ---- */
:root {
    --e20-primary:       #2563eb;
    --e20-primary-dark:  #1d4ed8;
    --e20-accent:        #10b981;
    --e20-bg:            #f8f9fa;
    --e20-radius:        12px;
    --e20-shadow:        0 2px 12px rgba(0,0,0,.08);
    --e20-shadow-hover:  0 8px 24px rgba(0,0,0,.16);
    --e20-posti-verde:   #16a34a;
    --e20-posti-arancio: #d97706;
    --e20-posti-rosso:   #dc2626;
}

/* ---- Focus Visible (accessibilità WCAG 2.1) ---- */
:focus-visible {
    outline: 3px solid var(--e20-primary);
    outline-offset: 2px;
}

/* ---- Hero Section (homepage) ---- */
.e20-hero {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    min-height: 42vh;
    overflow: hidden;
}
@media (min-width: 768px) {
    .e20-hero { min-height: 55vh; }
}
.e20-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.45) 0%, rgba(0,0,0,.1) 45%, rgba(0,0,0,0) 75%);
    pointer-events: none;
}
.e20-hero__content {
    position: relative;
    z-index: 2;
    padding: 2.5rem 1.5rem 2rem;
    color: #fff;
    width: 100%;
}
.e20-hero__title {
    font-size: clamp(1.75rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    text-shadow: 0 2px 8px rgba(0,0,0,.35);
    margin-bottom: .5rem;
}
.e20-hero__tagline {
    font-size: 1.1rem;
    opacity: .9;
    margin-bottom: 1.5rem;
}
/* Payoff tenant — ancorato in basso con position:absolute (Canvas sovrascrive display:flex) */
.e20-hero__payoff-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding-bottom: 1.75rem;
}
.e20-hero__payoff {
    display: inline-block;
    background: rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.6;
    padding: .55rem 1.1rem;
    border-radius: 6px;
    letter-spacing: .015em;
    margin: 0;
    max-width: 560px;
}

/* ---- Card Evento ---- */
.e20-card {
    border-radius: var(--e20-radius);
    box-shadow: var(--e20-shadow);
    overflow: hidden;
    transition: box-shadow .2s ease, transform .2s ease;
    background: #fff;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.e20-card:hover {
    box-shadow: var(--e20-shadow-hover);
}
.e20-card__img-wrap {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--e20-primary);
}
.e20-card__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s ease;
    display: block;
}
.e20-card:hover .e20-card__img-wrap img {
    transform: scale(1.03);
}
.e20-card__img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.5);
    font-size: 3rem;
}
.e20-card__badge-date {
    position: absolute;
    bottom: .6rem;
    left: .6rem;
    background: rgba(0,0,0,.72);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .25rem .55rem;
    border-radius: 6px;
    line-height: 1.4;
}
.e20-card__body {
    padding: 1rem 1.1rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.e20-card__title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: .5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #1a1a1a;
}
.e20-card__meta {
    font-size: .82rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: .35rem;
    margin-top: auto;
}
.e20-card__link {
    text-decoration: none;
    color: inherit;
}
.e20-card__link:hover { color: inherit; }

/* ---- Hero Evento (singoloevento) ---- */
.e20-event-hero {
    position: relative;
    width: 100%;
    max-height: 480px;
    overflow: hidden;
    background: var(--e20-primary);
}
.e20-event-hero__img {
    width: 100%;
    height: 100%;
    max-height: 480px;
    object-fit: cover;
    display: block;
}
.e20-event-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.6) 0%, rgba(0,0,0,0) 50%);
}
.e20-event-hero__title {
    position: absolute;
    bottom: 1.25rem;
    left: 1.5rem;
    right: 1.5rem;
    color: #fff;
    font-size: clamp(1.3rem, 3vw, 2rem);
    font-weight: 800;
    text-shadow: 0 2px 8px rgba(0,0,0,.4);
    margin: 0;
}
.e20-event-hero--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: rgba(255,255,255,.7);
}

/* ---- Progress Bar Posti (dinamica) ---- */
.e20-posti-bar {
    height: 8px;
    border-radius: 4px;
    background: #e5e7eb;
    overflow: hidden;
    margin: .4rem 0;
}
.e20-posti-bar__fill {
    height: 100%;
    border-radius: 4px;
    transition: width .4s ease;
}
.e20-posti-bar__fill--verde   { background: var(--e20-posti-verde); }
.e20-posti-bar__fill--arancio { background: var(--e20-posti-arancio); }
.e20-posti-bar__fill--rosso   { background: var(--e20-posti-rosso); }

/* ---- Sticky Bottom Bar ---- */
.e20-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 16px rgba(0,0,0,.1);
    padding: .75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: bottom .25s ease;
}
.e20-sticky-bar__title {
    font-weight: 600;
    font-size: .95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    display: none;
}
@media (min-width: 768px) {
    .e20-sticky-bar__title { display: block; }
}
.e20-sticky-bar__cta { flex-shrink: 0; }
@media (max-width: 767px) {
    .e20-sticky-bar__cta { width: 100%; }
}
.e20-sticky-bar-spacer { height: 80px; }

/* ---- Stato Conferma / Errore ---- */
.e20-stato {
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
    padding: 3rem 1.5rem;
}
.e20-stato__icona {
    font-size: 5rem;
    line-height: 1;
    margin-bottom: 1.25rem;
}
.e20-stato__titolo {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: .75rem;
}
.e20-stato__testo {
    font-size: 1rem;
    color: #555;
    margin-bottom: 1.5rem;
}
.e20-stato__evento-box {
    background: #f8f9fa;
    border-radius: var(--e20-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    text-align: left;
}
.e20-stato__evento-titolo {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: .4rem;
}
.e20-stato__evento-meta {
    font-size: .875rem;
    color: #666;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1rem;
}
.e20-stato__azioni {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    align-items: center;
}

/* ---- Icone stato ---- */
.e20-stato__icona--success { color: #16a34a; }
.e20-stato__icona--warning  { color: #d97706; }
.e20-stato__icona--error    { color: #dc2626; }
.e20-stato__icona--neutral  { color: #6b7280; }

/* ---- Form Iscrizione ---- */
.e20-form-section {
    background: #fff;
    border-radius: var(--e20-radius);
    box-shadow: var(--e20-shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.e20-form-label {
    font-weight: 600;
    font-size: .875rem;
    margin-bottom: .3rem;
    display: block;
}
.e20-form-label.required:after {
    content: ' *';
    color: #dc2626;
}

.e20-form-hint {
    font-size: .8rem;
    color: #6b7280;
    margin-top: .2rem;
}

.e20-field-error {
    font-size: .8rem;
    color: #dc2626;
    margin-top: .25rem;
    display: none;
}
.e20-field-error.visible { display: block; }

/* ---- Card Riepilogo Evento (colonna destra form) ---- */
.e20-riepilogo-card {
    border-radius: var(--e20-radius);
    box-shadow: var(--e20-shadow);
    background: #fff;
    position: sticky;
    top: 80px;
}
.e20-riepilogo-card__img-wrap {
    overflow: hidden;
    border-radius: var(--e20-radius) var(--e20-radius) 0 0;
    max-height: 220px;
}
.e20-riepilogo-card__img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}
.e20-riepilogo-card__body { padding: 1.25rem; }
.e20-riepilogo-card__titolo {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: .6rem;
}
.e20-riepilogo-card__meta {
    font-size: .875rem;
    color: #555;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

/* ---- Badge Gratuito ---- */
.e20-badge-gratuito {
    display: inline-block;
    background: #dcfce7;
    color: #16a34a;
    font-size: .78rem;
    font-weight: 700;
    padding: .2rem .6rem;
    border-radius: 20px;
}

/* ---- Banner Overbooking ---- */
.e20-banner-attesa {
    background: #fffbeb;
    border: 1.5px solid #f59e0b;
    border-radius: var(--e20-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: .75rem;
    align-items: flex-start;
}
.e20-banner-attesa__icona {
    color: #d97706;
    font-size: 1.4rem;
    flex-shrink: 0;
    margin-top: .1rem;
}
.e20-banner-attesa__testo {
    font-size: .95rem;
    color: #92400e;
    line-height: 1.5;
}

/* ---- Section Header (homepage) ---- */
.e20-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.e20-section-header__title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
}
.e20-section-header__link {
    font-size: .875rem;
    font-weight: 600;
}

/* ---- Stato Vuoto Catalogo ---- */
.e20-empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    color: #888;
}
.e20-empty-state__icona {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: .5;
}
.e20-empty-state__titolo {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: .5rem;
    color: #555;
}

/* ---- Card Campagna di Prevenzione ---- */
.e20-campagna-card {
    background: #fff;
    border-radius: var(--e20-radius);
    box-shadow: var(--e20-shadow);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s ease, transform .2s ease;
}
.e20-campagna-card:hover {
    box-shadow: var(--e20-shadow-hover);
    transform: translateY(-3px);
}
.e20-campagna-card__icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(22,163,74,.1);
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
}
.e20-campagna-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: .5rem;
    line-height: 1.35;
}
.e20-campagna-card__desc {
    font-size: .875rem;
    color: #555;
    line-height: 1.55;
    flex: 1;
    margin-bottom: .75rem;
}
.e20-campagna-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-top: auto;
    padding-top: .75rem;
    border-top: 1px solid #f0f0f0;
}
.e20-campagna-card__date {
    font-size: .8rem;
    color: #777;
    display: flex;
    align-items: center;
    gap: .35rem;
}
.e20-campagna-card__cta {
    font-size: .875rem;
    font-weight: 700;
    color: #16a34a;
    white-space: nowrap;
}

/* ---- Grid carte eventi (homepage) ---- */
/* Override del flex generico di custom.css: usa CSS Grid per colonne regolari */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    justify-items: stretch;
}
@media (max-width: 575px) {
    .card-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
/* L'anchor-link deve seguire l'altezza piena della cella grid */
.card-container .e20-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Limite larghezza: evita che una card singola occupi l'intera riga */
    max-width: 420px;
}

/* ---- Footer compatto ---- */
/* Reset degli stili Canvas su #footer.dark — sostituiti con BEM e20-footer */
#footer.e20-footer,
#footer.e20-footer * { box-sizing: border-box; }
#footer.e20-footer {
    background: #111827;
    border-top: 1px solid rgba(255,255,255,.07);
    padding: 1.25rem 0;
    margin: 0;
}
.e20-footer__inner {
    display: flex;
    align-items: center;
    gap: 1.5rem 2rem;
    flex-wrap: wrap;
}
.e20-footer__brand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    text-decoration: none;
}
.e20-footer__logo {
    height: 38px;
    width: auto;
    object-fit: contain;
    display: block;
}
.e20-footer__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.e20-footer__name {
    font-size: .875rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}
.e20-footer__address {
    font-size: .78rem;
    color: rgba(255,255,255,.45);
    line-height: 1.4;
}
.e20-footer__email {
    font-size: .78rem;
    color: rgba(255,255,255,.6);
    text-decoration: none;
    transition: color .15s;
}
.e20-footer__email:hover { color: #fff; }
.e20-footer__right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}
.e20-footer__social {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: rgba(255,255,255,.7);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: .8rem;
    transition: background .18s, color .18s;
    flex-shrink: 0;
}
.e20-footer__social:hover { background: var(--e20-primary); color: #fff; }
.e20-footer__copy {
    font-size: .72rem;
    color: rgba(255,255,255,.3);
    margin: 0;
    white-space: nowrap;
}
@media (max-width: 575px) {
    .e20-footer__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: .75rem;
    }
}

/* ---- Accessibilità: riduci animazioni se richiesto dal sistema ---- */
@media (prefers-reduced-motion: reduce) {
    .e20-card,
    .e20-card__img-wrap img,
    .e20-posti-bar__fill {
        transition: none;
    }
    .e20-card:hover .e20-card__img-wrap img {
        transform: none;
    }
}
