/**
 * Facile.Energy — Pagina Pagamenti Digitali (slug: pagamenti-digitali)
 * - Sfondo crema come la home
 * - Accenti verde tema
 * - Form di pagamento (Stripe/PayPal/Satispay via plugin "Stripe Pagamenti")
 * - Sezione "Pagamento automatico" su sfondo scuro
 *
 * @since 1.0.1
 */

/* ==========================================================================
   RESET & CONTAINER
   ========================================================================== */

body.rei-static-page--pagamenti-digitali,
body.rei-static-page--pagamenti {
    background: #fff;
}

.rei-pagamenti {
    /* v2.2: transparent — lascia trasparire la filigrana a tema del main */
    background: transparent;
    color: var(--rei-ink, #3C3C3B);
    position: relative;
    overflow-x: hidden; /* contiene i glow che escono dai lati */
}

/* ==========================================================================
   v1.0.5 — DECORAZIONI DI SFONDO (glow + banconote)
   ========================================================================== */
.rei-pagamenti__bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

/* Glow circles ai 4 angoli — alternati verde/giallo come la home */
.rei-pagamenti__glow {
    position: absolute;
    width: 540px;
    height: 540px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    pointer-events: none;
}
.rei-pagamenti__glow--tl {
    top: -180px;
    left: -180px;
    background: radial-gradient(circle, rgba(32,164,123, 0.55) 0%, rgba(32,164,123, 0) 70%);
}
.rei-pagamenti__glow--tr {
    top: -200px;
    right: -200px;
    background: radial-gradient(circle, rgba(209,224,0, 0.45) 0%, rgba(209,224,0, 0) 70%);
}
.rei-pagamenti__glow--bl {
    bottom: -180px;
    left: -200px;
    background: radial-gradient(circle, rgba(209,224,0, 0.45) 0%, rgba(209,224,0, 0) 70%);
}
.rei-pagamenti__glow--br {
    bottom: -180px;
    right: -180px;
    background: radial-gradient(circle, rgba(32,164,123, 0.55) 0%, rgba(32,164,123, 0) 70%);
}

/* Banconote in filigrana (v1.2.3: SVG inline + animazione continua loop come le particles home)
   Pulsano da piccole a grandi di continuo, come fiamme/lampadine della homepage. */
.rei-pagamenti__note {
    position: absolute;
    color: var(--rei-green, #20A47B);
    opacity: 0.22;
    pointer-events: none;
    will-change: transform, opacity;
    filter: drop-shadow(0 0 24px rgba(32,164,123, 0.55));
    animation: rei-note-pulse 4s ease-in-out infinite;
}
.rei-pagamenti__note svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Posizioni e dimensioni GIGANTI (filigrana) — 7 banconote sparse,
   delay diversi per movimento sfalsato */
.rei-pagamenti__note--1 { top: 6%;  left: 2%;  width: 240px; height: 135px; animation-delay: 0s; }
.rei-pagamenti__note--2 { top: 22%; right: 1%; width: 280px; height: 158px; animation-delay: 0.6s; }
.rei-pagamenti__note--3 { top: 40%; left: 4%;  width: 200px; height: 113px; animation-delay: 1.2s; }
.rei-pagamenti__note--4 { top: 58%; right: 3%; width: 300px; height: 169px; color: var(--rei-yellow, #D1E000); filter: drop-shadow(0 0 24px rgba(209,224,0, 0.5)); animation-delay: 1.8s; }
.rei-pagamenti__note--5 { top: 74%; left: 8%;  width: 220px; height: 124px; animation-delay: 2.4s; }
.rei-pagamenti__note--6 { top: 12%; left: 44%; width: 180px; height: 101px; animation-delay: 3s; }
.rei-pagamenti__note--7 { top: 88%; right: 14%; width: 250px; height: 141px; animation-delay: 3.6s; }

/* Animazione continua: cresce da piccola a grande e torna, con leggera rotazione */
@keyframes rei-note-pulse {
    0% {
        transform: scale(0.5) rotate(-8deg);
        opacity: 0.08;
    }
    50% {
        transform: scale(1.1) rotate(5deg);
        opacity: 0.28;
    }
    100% {
        transform: scale(0.5) rotate(-8deg);
        opacity: 0.08;
    }
}

/* Contenuto della pagina sopra le decorazioni */
.rei-pagamenti > section,
.rei-pagamenti > article {
    position: relative;
    z-index: 1;
}

/* Riduci motion se utente preferisce ridurre animazioni */
@media (prefers-reduced-motion: reduce) {
    .rei-pagamenti__note {
        animation: none;
        opacity: 0.15;
    }
}

/* ==========================================================================
   CONTAINER
   ========================================================================== */

.rei-pagamenti__container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 32px;
    box-sizing: border-box;
}

/* Override safety contro stili gutenberg che potrebbero esserci */
.rei-pagamenti * {
    box-sizing: border-box;
}

/* ==========================================================================
   SEZIONE 1 — HERO
   ========================================================================== */
.rei-pagamenti__hero {
    padding: 80px 0 60px;
    background: transparent; /* v1.2.2: trasparente per vedere bg decorativo */
}

.rei-pagamenti__eyebrow {
    display: inline-block;
    background: #D2F0E6;
    color: var(--rei-green-deep, #157155);
    padding: 8px 22px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 32px;
    border: 1px solid rgba(32,164,123, 0.25);
    line-height: 1.2;
}

.rei-pagamenti__title {
    font-size: clamp(2rem, 4.5vw, 3.4375rem);
    font-weight: 800;
    line-height: 1.12;
    text-transform: uppercase;
    color: #fff;
    margin: 0 0 24px;
}

.rei-pagamenti__title-green {
    color: #fff;
}

.rei-pagamenti__intro {
    font-size: 1.15rem;
    line-height: 1.65;
    color: #fff;
    max-width: 720px;
    margin: 0 0 48px;
}

/* Step dentro la banda: numeri in badge tondo bianco/verde */
.fe-page-hero .rei-pagamenti__step-num {
    color: #fff;
    background: rgba(255,255,255,0.16);
    border: 2px solid rgba(255,255,255,0.6);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    min-width: 60px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fe-page-hero .rei-pagamenti__step-text,
.fe-page-hero .rei-pagamenti__step-text strong,
.fe-page-hero .rei-pagamenti__step-text em {
    color: #fff;
}

/* 3 STEP — numero verde grande a sinistra, testo a destra */
.rei-pagamenti__steps {
    display: flex;
    flex-direction: column;
    gap: 36px;
    margin: 0 0 48px;
}

.rei-pagamenti__step {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 28px;
}

.rei-pagamenti__step-num {
    font-size: 3.4rem;
    font-weight: 800;
    line-height: 1;
    color: var(--rei-green, #20A47B);
    flex-shrink: 0;
    min-width: 60px;
    text-align: center;
}

.rei-pagamenti__step-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--rei-ink, #157155);
    margin: 8px 0 0;
    max-width: 640px;
    flex: 1;
}

.rei-pagamenti__step-text strong {
    font-weight: 700;
}

.rei-pagamenti__step-text em {
    font-style: italic;
}

/* CTA PROCEDI — bottone verde full-width pill */
.rei-pagamenti__cta {
    margin-top: 16px;
}

.rei-pagamenti__cta-btn {
    display: block;
    width: 100%;
    background: var(--rei-green, #20A47B);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 18px 32px;
    border-radius: 6px;
    text-align: center;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    /* v1.0.4: shadow ancora più presente */
    box-shadow:
        0 24px 50px -8px rgba(32,164,123, 0.55),
        0 12px 24px -6px rgba(32,164,123, 0.4),
        0 4px 10px rgba(21,113,85, 0.1);
    border: 0;
    cursor: pointer;
    line-height: 1.2;
}

.rei-pagamenti__cta-btn:hover {
    background: var(--rei-green-deep, #157155);
    color: #fff;
    transform: translateY(-4px);
    box-shadow:
        0 32px 60px -8px rgba(32,164,123, 0.6),
        0 18px 32px -6px rgba(32,164,123, 0.45),
        0 4px 10px rgba(21,113,85, 0.1);
    text-decoration: none;
}

/* ==========================================================================
   SEZIONE FORM DI PAGAMENTO (POST → /middle-payment/)
   ========================================================================== */
.rei-pagamenti__paga {
    padding: 0 0 72px;
    background: transparent;
}

.rei-pagamenti__form-card {
    background: #fff;
    border-radius: 28px;
    padding: 44px 40px;
    box-shadow:
        0 24px 60px -12px rgba(21,113,85, 0.2),
        0 10px 24px -8px rgba(21,113,85, 0.12),
        0 1px 3px rgba(21,113,85, 0.05);
    border: 2px solid var(--rei-green, #20A47B); /* v2.2: contorno verde su tutti i riquadri */
}

.rei-pagamenti__form-title {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 800;
    color: var(--rei-ink, #157155);
    margin: 0 0 10px;
    line-height: 1.2;
}

.rei-pagamenti__form-sub {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--rei-gray-text, #4D4D4D);
    margin: 0 0 32px;
    max-width: 640px;
}

.rei-pagamenti__form {
    margin: 0;
}

/* Scelta metodo di pagamento — SELECT (come il live) */
.rei-pagamenti__methods-choice {
    border: 0;
    padding: 0;
    margin: 0 0 4px;
}

.rei-pagamenti__select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%2320A47B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
    cursor: pointer;
}

/* Campi */
.rei-pagamenti__fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
    margin: 0 0 8px;
}

.rei-pagamenti__field {
    margin: 0 0 14px;
}

.rei-pagamenti__field--full {
    grid-column: 1 / -1;
}

.rei-pagamenti__label {
    display: block;
    font-weight: 700;
    font-size: 1rem;
    color: var(--rei-ink, #3C3C3B);
    margin-bottom: 8px;
    line-height: 1.35;
}

.rei-pagamenti__req {
    color: var(--rei-green-dark, #157155);
}

.rei-pagamenti__input {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--rei-ink, #3C3C3B);
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rei-pagamenti__input:focus {
    outline: none;
    border-color: var(--rei-green, #20A47B);
    box-shadow: 0 0 0 4px rgba(32,164,123, 0.18);
    background: #fff;
}

.rei-pagamenti__input::placeholder {
    color: #9aa0ad;
}

.rei-pagamenti__form-note {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--rei-gray-text, #4D4D4D);
    margin: 0 0 24px;
}

@media (max-width: 900px) {
    .rei-pagamenti__fields {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .rei-pagamenti__paga {
        padding-bottom: 48px;
    }
    .rei-pagamenti__form-card {
        padding: 28px 20px;
        border-radius: 20px;
    }
}

/* ==========================================================================
   SEZIONE 2 — ALTRI METODI (Bonifico + Bollettino)
   ========================================================================== */
.rei-pagamenti__altri {
    padding: 40px 0 80px;
    background: transparent; /* v1.2.2: trasparente per vedere bg decorativo */
}

/* Grid 3 colonne: titolo + 2 card */
.rei-pagamenti__altri-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 32px;
    align-items: stretch;
}

.rei-pagamenti__altri-title-col {
    display: flex;
    align-items: flex-start;
    padding-top: 12px;
}

.rei-pagamenti__section-title {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--rei-ink, #157155);
    margin: 0;
}

/* Card metodo: bianca, shadow marcata, icona tonda verde */
.rei-pagamenti__method-card {
    background: #fff;
    border-radius: 24px;
    padding: 32px 28px;
    /* v1.0.3: shadow più marcata, doppio layer per profondità */
    box-shadow:
        0 20px 50px -10px rgba(21,113,85, 0.18),
        0 8px 20px -8px rgba(21,113,85, 0.12),
        0 1px 3px rgba(21,113,85, 0.05);
    border: 2px solid var(--rei-green, #20A47B); /* v2.2: contorno verde su tutti i riquadri */
    display: flex;
    flex-direction: column;
    text-align: left;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.rei-pagamenti__method-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 28px 60px -12px rgba(21,113,85, 0.22),
        0 12px 24px -10px rgba(21,113,85, 0.15),
        0 1px 3px rgba(21,113,85, 0.06);
}

.rei-pagamenti__method-icon {
    /* v1.0.4: cerchi più grandi (era 72px) */
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: #D2F0E6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 18px;
    flex-shrink: 0;
    /* v1.0.3: shadow morbida per profondità */
    box-shadow: 0 8px 20px -4px rgba(32,164,123, 0.25);
}

.rei-pagamenti__method-icon svg {
    /* v1.0.4: icone più grandi proporzionate al cerchio (era 36px) */
    width: 48px !important;
    height: 48px !important;
    color: var(--rei-green, #20A47B);
    display: block;
}

.rei-pagamenti__method-title {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--rei-green, #20A47B);
    margin: 0 0 16px;
    line-height: 1.2;
}

.rei-pagamenti__method-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--rei-ink, #157155);
    margin: 0 0 28px;
    flex-grow: 1;
}

.rei-pagamenti__method-text p {
    margin: 0 0 0.8em;
}

.rei-pagamenti__method-text strong {
    font-weight: 700;
    word-break: break-word;
}

.rei-pagamenti__method-text em {
    font-style: italic;
}

/* Bottone della card: verde pill compatto */
.rei-pagamenti__method-btn {
    display: inline-block;
    background: var(--rei-green, #20A47B);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 13px 28px;
    border-radius: 999px;
    border: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    text-align: center;
    align-self: flex-start;
    line-height: 1.2;
    /* v1.0.3: shadow per dare profondità */
    box-shadow:
        0 10px 22px -6px rgba(32,164,123, 0.45),
        0 4px 10px -3px rgba(32,164,123, 0.3);
}

.rei-pagamenti__method-btn:hover {
    background: var(--rei-green-deep, #157155);
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow:
        0 14px 28px -6px rgba(32,164,123, 0.55),
        0 6px 14px -3px rgba(32,164,123, 0.35);
}

/* ==========================================================================
   SEZIONE 3 — PAGAMENTO AUTOMATICO (sfondo grigio neutro, palette REI)
   v1.0.4: sfondo grigio invece di ink scuro (i cerchi verdi chiari non si
   vedevano bene su ink quasi nero)
   ========================================================================== */
.rei-pagamenti__auto {
    background: var(--rei-green-dark, #157155);
    color: #fff;
    padding: 80px 0;
}

.rei-pagamenti__auto-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.rei-pagamenti__section-title--light {
    color: #fff;
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    margin: 0;
}

/* v1.1.3: Coccarda/medaglia "timbro di qualità" (sostituisce il badge pillola) */
.rei-pagamenti__auto-badge {
    flex-shrink: 0;
    display: block;
    line-height: 0;
}

.rei-pagamenti__medal {
    width: 180px;
    height: auto;
    display: block;
    filter: drop-shadow(0 10px 24px rgba(21,113,85, 0.4));
}

.rei-pagamenti__auto-content {
    max-width: 920px;
    margin: 0 0 40px;
}

.rei-pagamenti__auto-text {
    font-size: 1rem;
    line-height: 1.7;
    color: #fff;
    margin: 0 0 18px;
}

.rei-pagamenti__auto-text strong {
    color: #fff;
    font-weight: 700;
}

.rei-pagamenti__auto-text em {
    font-style: italic;
    opacity: 0.95;
}

.rei-pagamenti__auto-help {
    font-weight: 700;
    color: #fff;
    margin: 36px 0 32px;
    font-size: 1.05rem;
}

/* 3 metodi attivazione: icona tonda verde a sinistra + testo */
.rei-pagamenti__auto-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.rei-pagamenti__auto-method {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 18px;
}

.rei-pagamenti__auto-method-icon {
    /* v1.0.4: cerchi più grandi (era 72px) */
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: #D2F0E6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    /* v1.0.3: shadow morbida */
    box-shadow: 0 8px 20px -4px rgba(32,164,123, 0.4);
}

.rei-pagamenti__auto-method-icon svg {
    /* v1.0.4: icone più grandi (era 36px) */
    width: 48px !important;
    height: 48px !important;
    color: var(--rei-green, #20A47B);
    display: block;
}

.rei-pagamenti__auto-method-text {
    /* v1.1.1: font leggermente più grande per leggibilità */
    font-size: 0.98rem;
    line-height: 1.45;
    color: #fff;
    flex: 1;
}

.rei-pagamenti__auto-method-text strong {
    display: block;
    color: #fff;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.3;
}

.rei-pagamenti__auto-method-text a {
    /* lime per contrasto sul verde scuro */
    color: var(--rei-yellow, #D1E000);
    text-decoration: underline;
    font-weight: 700;
    word-break: break-word;
}

.rei-pagamenti__auto-method-text a:hover {
    color: #fff;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
    .rei-pagamenti__altri-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .rei-pagamenti__altri-title-col {
        padding-top: 0;
    }
    .rei-pagamenti__auto-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .rei-pagamenti__container {
        padding: 0 20px;
    }
    .rei-pagamenti__hero {
        padding: 56px 0 40px;
    }
    .rei-pagamenti__altri {
        padding: 32px 0 56px;
    }
    .rei-pagamenti__auto {
        padding: 56px 0;
    }
    .rei-pagamenti__step {
        gap: 18px;
    }
    .rei-pagamenti__step-num {
        font-size: 2.4rem;
        min-width: 44px;
    }
    .rei-pagamenti__step-text {
        font-size: 0.95rem;
        margin-top: 4px;
    }
    .rei-pagamenti__cta-btn {
        padding: 18px 24px;
        font-size: 1rem;
    }
    .rei-pagamenti__method-card {
        padding: 28px 22px;
    }
    .rei-pagamenti__method-icon {
        width: 60px;
        height: 60px;
    }
    .rei-pagamenti__method-icon svg {
        width: 28px !important;
        height: 28px !important;
    }
    .rei-pagamenti__method-title {
        font-size: 1.35rem;
    }
    .rei-pagamenti__auto-methods {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .rei-pagamenti__auto-method-icon {
        width: 60px;
        height: 60px;
    }
    .rei-pagamenti__auto-method-icon svg {
        width: 28px !important;
        height: 28px !important;
    }
    .rei-pagamenti__medal {
        width: 140px;
    }
}
