/* ==========================================================================
   GS Brevo Sync — Popup & Pagina Statica di Iscrizione
   Brand colors Generazione Senior:
     Blu scuro: #074470
     Oro:       #daa520
     Grigio:    #708090
   ========================================================================== */

/* --------------------------------------------------------------------------
   Overlay
   -------------------------------------------------------------------------- */
.gs-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba( 0, 0, 0, 0.65 );
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    /* Permette scroll se la box supera l'altezza viewport su mobile */
    overflow-y: auto;
}

/* Impedisce lo scroll del body quando il popup è aperto */
body.gs-popup-open {
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Box popup
   -------------------------------------------------------------------------- */
.gs-popup-box {
    background: #ffffff;
    border-radius: 10px;
    padding: 40px 44px 36px;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 0 8px 40px rgba( 0, 0, 0, 0.25 );
    /* Nessun max-height fisso: si adatta al contenuto;
       se supera il viewport, l'overlay stesso è scrollabile */
    margin: auto; /* centra verticalmente quando l'overlay è in overflow */
}

/* Pulsante chiusura */
.gs-popup-close {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 22px;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    color: #708090;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.15s, background-color 0.15s;
    z-index: 1;
}

.gs-popup-close:hover,
.gs-popup-close:focus {
    color: #074470;
    background-color: rgba( 7, 68, 112, 0.08 );
    outline: none;
}

/* --------------------------------------------------------------------------
   Logo (popup e pagina statica)
   -------------------------------------------------------------------------- */
.gs-popup-logo,
.gs-sub-page-logo {
    text-align: center;
    margin-bottom: 20px;
}

.gs-popup-logo img,
.gs-sub-page-logo img {
    max-width: 180px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: inline-block;
}

/* --------------------------------------------------------------------------
   Titolo e sottotitolo popup
   -------------------------------------------------------------------------- */
.gs-popup-title {
    margin: 0 0 10px;
    font-size: 1.45em;
    line-height: 1.3;
    color: #074470;
    text-align: center;
}

.gs-popup-subtitle {
    margin: 0 0 22px;
    color: #708090;
    line-height: 1.6;
    text-align: center;
    font-size: 0.95em;
}

/* --------------------------------------------------------------------------
   Form campi (condivisi tra popup e pagina statica)
   -------------------------------------------------------------------------- */
.gs-brevo-form .gs-field {
    margin-bottom: 16px;
}

.gs-brevo-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.875em;
    color: #333;
}

.gs-required {
    color: #c0392b;
    margin-left: 2px;
}

.gs-brevo-form input[type="text"],
.gs-brevo-form input[type="email"] {
    width: 100%;
    padding: 10px 13px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    line-height: 1.4;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: #222;
    background: #fff;
}

.gs-brevo-form input[type="text"]:focus,
.gs-brevo-form input[type="email"]:focus {
    border-color: #074470;
    box-shadow: 0 0 0 3px rgba( 7, 68, 112, 0.15 );
    outline: none;
}

/* Campo checkbox privacy */
.gs-field--checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: normal;
    font-size: 0.875em;
    color: #555;
    cursor: pointer;
    line-height: 1.5;
}

.gs-field--checkbox input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 2px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #074470;
}

.gs-field--checkbox a {
    color: #074470;
    text-decoration: underline;
}

.gs-field--checkbox a:hover {
    color: #daa520;
}

/* Pulsante submit */
.gs-btn-submit {
    display: block;
    width: 100%;
    padding: 13px 20px;
    margin-top: 14px;
    background: #074470;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    letter-spacing: 0.02em;
}

.gs-btn-submit:hover {
    background: #0a5a96;
}

.gs-btn-submit:active {
    transform: scale( 0.98 );
}

.gs-btn-submit:focus {
    outline: 3px solid rgba( 218, 165, 32, 0.5 );
    outline-offset: 2px;
}

.gs-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Messaggi di risposta */
.gs-form-messages {
    display: block;
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 5px;
    font-size: 0.9em;
    line-height: 1.5;
}

.gs-form-messages:empty {
    padding: 0;
    margin-top: 0;
}

.gs-msg-success {
    background: #edfaed;
    color: #1e6b1e;
    border: 1px solid #a3d9a3;
}

.gs-msg-error {
    background: #fff0f0;
    color: #8b0000;
    border: 1px solid #f5aaaa;
}

/* --------------------------------------------------------------------------
   Pagina statica — struttura
   -------------------------------------------------------------------------- */
.gs-subscription-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;

    /* Sfondo con gradiente brand colors */
    background-color: #074470;
    background-image:
        /* Cerchio decorativo oro in alto a destra */
        radial-gradient(
            ellipse 60% 50% at 90% 10%,
            rgba( 218, 165, 32, 0.18 ) 0%,
            transparent 70%
        ),
        /* Cerchio decorativo blu chiaro in basso a sinistra */
        radial-gradient(
            ellipse 55% 45% at 5% 90%,
            rgba( 10, 90, 150, 0.55 ) 0%,
            transparent 70%
        ),
        /* Gradiente principale diagonale */
        linear-gradient(
            135deg,
            #074470 0%,
            #0a5a96 40%,
            #074470 70%,
            #052f4d 100%
        );
}

.gs-sub-page-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    box-sizing: border-box;
    position: relative;
}

/* Striscia decorativa oro in cima */
.gs-sub-page-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient( 90deg, #daa520, #f0c040, #daa520 );
    z-index: 1;
}

/* --------------------------------------------------------------------------
   Pagina statica — card
   -------------------------------------------------------------------------- */
.gs-sub-page-box {
    background: #ffffff;
    border-radius: 14px;
    padding: 52px 56px 48px;
    max-width: 540px;
    width: 100%;
    position: relative;
    z-index: 2;

    /* Bordo superiore oro */
    border-top: 4px solid #daa520;

    /* Ombra profonda */
    box-shadow:
        0 20px 60px rgba( 0, 0, 0, 0.3 ),
        0 2px 8px rgba( 0, 0, 0, 0.15 );
}

/* Titolo pagina statica */
.gs-sub-page-title {
    margin: 0 0 12px;
    font-size: 1.75em;
    line-height: 1.25;
    color: #074470;
    text-align: center;
}

/* Sottotitolo pagina statica */
.gs-sub-page-subtitle {
    margin: 0 0 28px;
    font-size: 0.975em;
    color: #708090;
    line-height: 1.65;
    text-align: center;
}

/* Separatore decorativo sotto il logo nella pagina statica */
.gs-sub-page-logo {
    margin-bottom: 24px;
}

.gs-sub-page-logo::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: #daa520;
    margin: 16px auto 0;
    border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media ( max-width: 600px ) {

    /* Popup: padding ridotto, box si adatta */
    .gs-popup-box {
        padding: 32px 18px 24px;
        border-radius: 8px;
    }

    .gs-popup-title {
        font-size: 1.25em;
    }

    .gs-popup-logo img {
        max-height: 60px;
        max-width: 140px;
    }

    /* Pagina statica: card quasi edge-to-edge */
    .gs-sub-page-box {
        padding: 36px 20px 28px;
        border-radius: 10px;
    }

    .gs-sub-page-title {
        font-size: 1.4em;
    }

    .gs-sub-page-logo img {
        max-height: 64px;
        max-width: 160px;
    }

    .gs-btn-submit {
        font-size: 15px;
        padding: 12px 16px;
    }
}
