/* ==========================================================================
   TEMA CUSTOM: Francesco Totti "OLTRE" (.theme-totti)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABILI & SETUP BASE
   -------------------------------------------------------------------------- */
:root,
.theme-totti {
    --totti-dark-start: #2a3538;
    --totti-dark-end: #171f21;
    --totti-footer-bg: #13191b;
    --totti-beige-bg: #eae5d8;
    --totti-lime: #c2d258;
    --totti-lime-hover: #b0c046;
    --totti-lime-dark: #8ba008;
    --totti-gold-text: #dce4a2;
    --totti-text-dark: #222222;
    --totti-border-color: #d0caba;
}

@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,100..900;1,100..900&display=swap');

.theme-totti {
    background-color: var(--totti-beige-bg);
    color: var(--totti-text-dark);
    font-family: 'Roboto Condensed', Arial, sans-serif;
    margin: 0;
    padding: 0;
}


.btn-primary {
    background-color: var(--totti-lime);
    border-color: var(--totti-lime);
    color: var(--totti-text-dark);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--totti-lime-hover);
    border-color: var(--totti-lime-hover);
    color: var(--totti-text-dark);
}

a {
    color: var(--totti-lime-dark);
    text-decoration: none;
}
a:hover,
a:focus {
    color: var(--totti-lime-dark);
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   2. SITE HEADER SEMANTICO & RESPONSIVE
   -------------------------------------------------------------------------- */
.site-header {
    background: var(--totti-dark-start);
    background: linear-gradient(180deg, var(--totti-dark-start) 0%, var(--totti-dark-end) 100%);
    color: #ffffff;
    position: relative;
    z-index: 100;
    position: sticky;
    top: 0;
}

.site-header .header-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-header .site-brand .brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #ffffff;
    text-decoration: none;
}

.site-header .site-brand .brand-logo {
    max-height: 40px;
    width: auto;
}

.site-header .site-brand .brand-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--totti-gold-text);
    letter-spacing: 0.5px;
}

.site-header .nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.site-header .menu-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
    padding: 0.5rem 0;
}

.site-header .menu-link:hover,
.site-header .menu-link:focus {
    color: var(--totti-lime);
}

.site-header .menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 0.5rem;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 700;
}

.site-header .menu-toggle-icon {
    display: inline-block;
    width: 22px;
    height: 2px;
    background: #ffffff;
    position: relative;
    transition: background 0.2s ease;
}

.site-header .menu-toggle-icon::before,
.site-header .menu-toggle-icon::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 2px;
    background: #ffffff;
    left: 0;
    transition: transform 0.2s ease;
}

.site-header .menu-toggle-icon::before { top: -6px; }
.site-header .menu-toggle-icon::after  { top: 6px; }

/* --------------------------------------------------------------------------
   3. HERO SECTION (Sfondo Gradiente Scuro)
   -------------------------------------------------------------------------- */
.section-hero,
.theme-totti .section-hero {
    background: var(--totti-dark-start);
    background: linear-gradient(180deg, var(--totti-dark-start) 0%, var(--totti-dark-end) 100%);
    color: #ffffff;
    padding: 3.5rem 1rem;
}

.hero-wrapper {
    max-width: 1080px;
    margin: 0 auto;
}

.hero-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    align-items: center;
    text-align: center;
}

@media (min-width: 768px) {
    .hero-container {
        display: grid;
        grid-template-columns: 1fr 420px;
        gap: 3.5rem;
        text-align: left;
        align-items: center;
    }
}

.hero-title,
.theme-totti .hero-title {
    color: var(--totti-gold-text) !important;
    font-weight: 500;
    font-size: 2.2rem;
    line-height: 1.25;
    margin-bottom: 1rem;
}

.hero-title,
.theme-totti .hero-title h1 {
    font-weight: 800;
    font-size: 3rem;
}


.hero-subtitle,
.theme-totti .hero-subtitle {
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.95;
    margin-bottom: 1.5rem;
}

.event-box,
.theme-totti .event-box {
    border: 2.5px dashed rgba(255, 255, 255, 0.45);
    border-radius: 2em;
    padding: 1.5rem 3rem;
    color: #ffffff;
    margin-bottom: 1.5rem;
    width: fit-content;
}

.event-box p {
  font-size: 1.4rem;
    margin: 0;
    line-height: 1.4;
}

.book-cover,
.theme-totti .book-cover {
    max-height: 480px;
    width: auto;
    max-width: 100%;
    filter: drop-shadow(0px 15px 25px rgba(0, 0, 0, 0.6));
}

/* --------------------------------------------------------------------------
   4. PULSANTI TEMA
   -------------------------------------------------------------------------- */
.btn-theme,
.theme-totti .btn-theme {
    background-color: var(--totti-lime);
    color: var(--totti-text-dark);
    font-weight: 800;
    font-size: 0.9rem;
    text-transform: uppercase;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 2.25rem;
    letter-spacing: 0.5px;
    transition: all 0.2s ease-in-out;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    width: auto;
}

.btn-theme:hover,
.btn-theme:focus,
.theme-totti .btn-theme:hover,
.theme-totti .btn-theme:focus {
    background-color: var(--totti-lime-hover);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: var(--totti-text-dark);
}

.btn-dark-theme {
    background-color: var(--totti-dark-start) !important;
    color: var(--totti-gold-text) !important;
}

.btn-dark-theme:hover {
    background-color: var(--totti-dark-end) !important;
}

/* --------------------------------------------------------------------------
   5. AUTH SECTION (Login & Registrazione)
   -------------------------------------------------------------------------- */
.auth-section,
.theme-totti .auth-section {
    background-color: var(--totti-beige-bg);
    color: var(--totti-text-dark);
    padding: 4rem 1rem;
}

.auth-wrapper {
    max-width: 960px;
    margin: 0 auto;
}

.auth-title,
.theme-totti .auth-title {
    font-weight: 500;
    font-size: 1.6rem;
    color: var(--totti-text-dark);
    text-align: center;
    margin-bottom: 3.5rem;
}

.auth-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

@media (min-width: 768px) {
    .auth-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0;
        align-items: stretch;
    }

    .login-box {
        padding-right: 3.5rem;
    }

    .register-box {
        border-left: 1px solid var(--totti-border-color);
        padding-left: 3.5rem;
    }
}

.auth-lead {
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    line-height: 1.45;
}

.auth-text {
    font-size: 0.88rem;
    color: #555555;
    margin-bottom: 1.75rem;
    line-height: 1.5;
}

.auth-section .form-group {
    margin-bottom: 1.25rem;
}

.auth-section .form-group label,
.auth-section .control-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: #333333;
}

.auth-section .form-control {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 4px;
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.auth-section .form-control:focus {
    border-color: var(--totti-lime-hover);
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(194, 210, 88, 0.25);
}

.auth-section .help-block.error-message {
    color: #d9534f;
    font-size: 0.8rem;
    margin-top: 0.35rem;
}

.form-actions {
    margin-top: 1.25rem;
}

.auth-links {
    margin-top: 2rem;
    font-size: 0.85rem;
}

.forgot-link {
    display: block;
    color: var(--totti-text-dark);
    text-decoration: underline;
    margin-bottom: 0.75rem;
}

.support-info {
    color: #666666;
    margin: 0;
    line-height: 1.4;
}

.support-info a {
    color: var(--totti-text-dark);
    text-decoration: underline;
}

.has-error .help-block {
    color: #d9534f;
    font-size: 0.8rem;
    margin-top: 0.35rem;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   6. SEZIONE EVENTI (.events-section)
   -------------------------------------------------------------------------- */
.events-section {
    padding: 3rem 1rem;
    background-color: var(--totti-beige-bg);
    color: var(--totti-text-dark);
}

.events-wrapper {
    max-width: 960px;
    margin: 0 auto;
}

/* Messaggi di Feedback PJAX */
.flash-message {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.flash-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.events-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* BADGES & STATI GENERALI */
.badge-pill {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
}

.status-green { background-color: #e8f5e9; color: #28a745; }
.status-amber { background-color: #fef3c7; color: #d97706; }
.status-red   { background-color: #f8d7da; color: #dc3545; }

.text-green { color: #28a745; font-weight: 700; font-size: 0.88rem; }
.text-amber { color: #d97706; font-weight: 700; font-size: 0.88rem; }
.text-red   { color: #dc3545; font-weight: 700; font-size: 0.88rem; }

/* COMPONENTI PILLOLA (Accompagnatore e Avviso) */
.pill-checkbox {
    display: inline-block;
    background-color: var(--totti-beige-bg);
    border: 1px solid var(--totti-border-color);
    border-radius: 50px;
    padding: 0.4rem 1.25rem;
    margin-bottom: 1rem;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--totti-text-dark);
    cursor: pointer;
}

.checkbox-input {
    width: 17px;
    height: 17px;
    accent-color: var(--totti-lime);
    cursor: pointer;
}

.pill-notice {
    display: inline-block;
    background-color: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
    border-radius: 50px;
    padding: 0.4rem 1.25rem;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   6A. FORMATO 1: SCHEDA DETTAGLIATA (.layout-detailed)
   -------------------------------------------------------------------------- */
.layout-detailed .event-card {
    background: #ffffff;
    border: 1px solid var(--totti-border-color);
    border-radius: 12px;
    padding: 2.25rem 2rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.layout-detailed .event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.layout-detailed .event-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    color: var(--totti-text-dark);
}

/* Box Tratteggiato Dati Evento (Identico all'Hero) */
.layout-detailed .event-box-dark {
    background-color: var(--totti-dark-start);
    border: 1.5px dashed rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    padding: 0.9rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 0.92rem;
}

.layout-detailed .event-box-dark address {
    font-style: normal;
    color: var(--totti-gold-text);
}

.layout-detailed .event-box-dark time {
    color: #ffffff;
}

.layout-detailed .event-abstract {
    text-align: center;
    color: #555555;
    font-size: 0.95rem;
    line-height: 1.55;
    margin: 0 0 1.75rem 0;
}

/* Azionamento Centrato */
.layout-detailed .event-footer {
    border-top: 1px solid var(--totti-beige-bg);
    padding-top: 1.5rem;
    text-align: center;
}

.layout-detailed .event-form-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.layout-detailed .btn-hero-style {
    min-width: 280px;
    padding: 0.85rem 2rem;
    font-size: 0.95rem;
}

.layout-detailed .action-subtext {
    font-size: 0.8rem;
    color: #888888;
    margin-top: 0.75rem;
    margin-bottom: 0;
}

.layout-detailed .soldout-notice-box {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    max-width: 480px;
    margin: 0 auto;
}

.layout-detailed .soldout-notice-box strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.layout-detailed .soldout-notice-box p {
    margin: 0;
    font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   6B. FORMATO 2: LISTA COMPATTA (.layout-compact)
   -------------------------------------------------------------------------- */
.layout-compact .event-card {
    background: #ffffff;
    border: 1px solid var(--totti-border-color);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

@media (min-width: 768px) {
    .layout-compact .event-card {
        display: grid;
        grid-template-columns: 1fr 280px;
        align-items: center;
        gap: 2rem;
    }
}

.layout-compact .event-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
}

.layout-compact .event-meta-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.88rem;
    color: #555555;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.layout-compact .event-meta-inline address {
    font-style: normal;
}

.layout-compact .compact-action {
    text-align: center;
}

@media (min-width: 768px) {
    .layout-compact .compact-action {
        text-align: right;
    }
}

.layout-compact .compact-form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

@media (min-width: 768px) {
    .layout-compact .compact-form {
        align-items: flex-end;
    }
}

.layout-compact .btn-sm-block {
    width: 100%;
    padding: 0.7rem 1.25rem;
    font-size: 0.85rem;
}

.layout-compact .badge-soldout-box {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.9rem;
    text-align: center;
}

/* --------------------------------------------------------------------------
   7. FOOTER
   -------------------------------------------------------------------------- */
.main-footer,
.theme-totti .main-footer {
    background-color: var(--totti-footer-bg) !important;
    color: #888888;
    font-size: 0.8rem;
    padding: 2.5rem 1rem;
    line-height: 1.5;
}

.main-footer a,
.theme-totti .main-footer a {
    color: #aaaaaa;
    text-decoration: underline;
}

.main-footer p {
    margin-bottom: 0.4rem;
}

/* --------------------------------------------------------------------------
   8. MEDIA QUERIES MOBILE (< 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    .site-header .menu-toggle {
        display: flex;
    }

    .site-header .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--totti-dark-end);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
    }

    .site-header .main-nav.is-open {
        max-height: 400px;
        transition: max-height 0.3s ease-in-out;
    }

    .site-header .nav-list {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 1.5rem;
        gap: 0;
    }

    .site-header .menu-item {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .site-header .menu-link {
        display: block;
        padding: 0.85rem 0;
        width: 100%;
    }

    .section-hero,
    .theme-totti .section-hero {
        padding: 2.5rem 1rem;
    }

    .hero-title,
    .theme-totti .hero-title {
        font-size: 1.75rem;
    }

    .event-box,
    .theme-totti .event-box {
        width: 100%;
        box-sizing: border-box;
    }

    .book-cover,
    .theme-totti .book-cover {
        max-height: 320px;
    }

    .auth-section,
    .theme-totti .auth-section {
        padding: 2.5rem 1rem;
    }

    .login-box,
    .register-box {
        padding: 0;
        border: none;
    }

    .layout-detailed .event-card {
        padding: 1.5rem 1rem;
    }

    .layout-detailed .event-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .layout-detailed .event-box-dark {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .layout-detailed .btn-hero-style {
        width: 100%;
        box-sizing: border-box;
    }

    .btn-theme {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .main-footer,
    .theme-totti .main-footer {
        text-align: left;
        padding: 2rem 1rem;
    }
}