/* ============================================= */
/* == PREMIUM SUBSCRIPTION PAGE STYLES V3 == */
/* ============================================= */

/* --- FONDAMENTA E VARIABILI --- */
:root {
    --bg-primary: #0D1117;
    --bg-card: #161B22;
    --text-primary: #E6EDF3;
    --text-secondary: #848D97;
    --border-primary: #30363D;
    --border-highlight: #A37C27;

    /* Palette Accent */
    --accent-gold: #D4AF37;
    --accent-pro-glow: rgba(129, 161, 193, 0.5);
    --accent-pro-color: #81A1C1;
    --accent-success: #238636; /* Verde per status attivo */

    /* Brand Colors */
    --brand-paypal-blue: #0070BA;
    --brand-apple-black: #000000;
    --brand-google-blue: #4285F4;

    /* Stili UI */
    --border-radius-card: 16px;
    --border-radius-btn: 30px;
    --shadow-card: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-card-hover: 0 10px 30px rgba(0,0,0,0.2);
    --shadow-pro: 0 0 25px var(--accent-pro-glow);
    --font-main: 'Montserrat', sans-serif;
    --transition-smooth: all 0.3s ease-in-out;
}

/* ... (stili generici del body, header, etc. rimangono invariati) ... */
body.subscription-page { background: var(--bg-primary); font-family: var(--font-main); color: var(--text-primary); }
.dashboard-main .page-header { text-align: center; margin-bottom: 2rem; }
.dashboard-main .page-header h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text-primary); }
.dashboard-main .page-header p { font-size: 1.1rem; color: var(--text-secondary); max-width: 500px; margin: 0 auto; }
.plans-wrapper { display: flex; gap: 2.5rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2rem; }

/* --- CARD DEI PIANI (INVARIATO) --- */
.plan-card { background: var(--bg-card); border-radius: var(--border-radius-card); border: 1px solid var(--border-primary); padding: 2.5rem 2rem; width: 100%; max-width: 350px; flex: 1 1 320px; display: flex; flex-direction: column; align-items: center; text-align: center; transition: var(--transition-smooth); position: relative; overflow: hidden; }
.plan-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-card-hover); border-color: rgba(163, 124, 39, 0.4); }
.plan-card.pro { border-color: var(--accent-pro-color); box-shadow: var(--shadow-pro); }
.plan-card.pro::before { content: 'MOST POPULAR'; position: absolute; top: 20px; right: -38px; background: var(--accent-pro-color); color: var(--bg-primary); font-size: 0.8rem; font-weight: 700; padding: 8px 40px; transform: rotate(45deg); z-index: 1; letter-spacing: 0.5px; }
.plan-toggle { display: flex; background: #0D1117; border-radius: var(--border-radius-btn); padding: 5px; margin-bottom: 1rem; border: 1px solid var(--border-primary); }
.toggle-btn { background: transparent; color: var(--text-secondary); border: none; border-radius: 25px; padding: 10px 20px; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: var(--transition-smooth); outline: none; }
.toggle-btn.active { background: var(--accent-gold); color: #111; box-shadow: 0 2px 10px rgba(212, 175, 55, 0.2); }
.toggle-btn .discount { background: rgba(212, 175, 55, 0.15); color: var(--accent-gold); padding: 2px 6px; border-radius: 8px; font-size: 0.85em; font-weight: 700; margin-left: 6px; }
.toggle-btn.active .discount { background: rgba(0,0,0,0.1); color: #111; }
.plan-toggle-desc { color: var(--accent-gold); font-size: 1rem; font-weight: 500; margin-bottom: 1.5rem; height: 20px; }

/* === PRICE DISPLAY REFINED === */
.plan-prices {
    margin-bottom: 2rem;
    min-height: 80px;
    padding: 1rem 0;
    border-top: 1px solid var(--border-primary);
    border-bottom: 1px solid var(--border-primary);
    background: linear-gradient(180deg, rgba(22, 27, 34, 0) 0%, rgba(30, 36, 45, 0.3) 100%);
    width: 100%;
}
.plan-price { 
    display: none; 
    align-items: baseline;
    justify-content: center;
    gap: 0.1rem;
}
.plan-price.active { 
    display: flex;
    animation: fadeIn 0.4s ease-in-out; 
}
.price-currency {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 0.5em;
}
.price-main {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}
.price-decimal {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
}
.price-period {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}
.plan-price .old-price { 
    text-decoration: line-through; 
    color: var(--text-secondary); 
    font-size: 1.1rem; 
    opacity: 0.7; 
    margin-left: 0.75rem;
    align-self: center;
}
/* === END PRICE DISPLAY === */

.plan-card h2 { font-size: 1.8rem; font-weight: 600; margin-bottom: 1rem; letter-spacing: 0.5px; }
.plan-card.base h2 { color: var(--accent-gold); }
.plan-card.pro h2 { color: var(--accent-pro-color); }
.plan-features { list-style: none; padding: 0; margin: 0 0 2rem 0; width: 100%; text-align: left; flex-grow: 1; }
.plan-features li { display: flex; align-items: center; font-size: 1.05rem; margin-bottom: 0.8rem; color: var(--text-secondary); gap: 0.8rem; }
.plan-features li i.fa-check { color: var(--accent-gold); }
.plan-features li i.fa-minus { color: #444; }
.plan-features li, .plan-features li i { transition: color 0.3s ease; }
.plan-card:hover .plan-features li { color: var(--text-primary); }


/* --- PULSANTI DI PAGAMENTO (AGGIORNATI) --- */
.pay-buttons { display: flex; flex-direction: column; gap: 0.8rem; width: 100%; margin-top: auto; }

.pay-buttons button {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
    font-size: 1.05rem; font-weight: 600; border-radius: var(--border-radius-btn);
    padding: 14px 0; cursor: pointer; transition: var(--transition-smooth); letter-spacing: 0.5px;
    border: 1px solid var(--border-primary); background: var(--bg-card); color: var(--text-primary);
}
.pay-buttons button:hover { transform: scale(1.03); box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.pay-buttons button i {
    font-size: 1.5rem;
    margin-right: 8px;
    vertical-align: middle;
}
.pay-note {
    display: block;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}
.applepay-btn[disabled], .googlepay-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    background: #222;
    color: #fff;
    border-color: #444;
}

/* Pulsante primario per carta di credito */
.card-btn {
    background: var(--accent-gold);
    color: #111;
    border-color: var(--accent-gold);
}
.card-btn:hover { background: #e7c859; border-color: #e7c859; }

/* Pulsanti con colori brand */
.paypal-btn { border-color: var(--brand-paypal-blue); }
.paypal-btn:hover { background: var(--brand-paypal-blue); color: #fff; }
.paypal-btn i { color: var(--brand-paypal-blue); }
.paypal-btn:hover i { color: #fff; }

.applepay-btn { background-color: var(--brand-apple-black); border-color: var(--brand-apple-black); }
.applepay-btn i { color: #fff; }
.applepay-btn:hover { background-color: #222; }

.googlepay-btn { border-color: #ddd; background: #fff; color: #333; }
.googlepay-btn i { color: var(--brand-google-blue); }
.googlepay-btn:hover { border-color: var(--brand-google-blue); }


/* --- ACTIVE SUBSCRIPTION STATUS CARD (NEW DESIGN) --- */
.subscription-status-box { animation: fadeIn 0.5s ease-in-out; }
.subscription-premium-box.active-plan {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--border-radius-card);
    padding: 1.5rem 2rem;
    max-width: 500px;
    margin: 0 auto 2rem auto;
    box-shadow: var(--shadow-card);
    border-left: 5px solid var(--accent-success); /* Bordo laterale per indicare stato attivo */
}
.active-plan .sub-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.active-plan .plan-badge { font-weight: 700; font-size: 1rem; border-radius: 8px; padding: 0.4rem 1rem; text-transform: uppercase; }
.active-plan .plan-badge.base { background: var(--accent-gold); color: #111; }
.active-plan .plan-badge.pro { background: var(--accent-pro-color); color: var(--text-primary); }
.active-plan .status-badge { color: var(--accent-success); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.active-plan .sub-details { color: var(--text-secondary); margin-bottom: 1rem; }
.active-plan .sub-details strong { color: var(--text-primary); font-weight: 600; }
.active-plan .sub-progress { margin-bottom: 1.5rem; }
.active-plan .progress-bar-label { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.active-plan .progress-bar-container { width: 100%; background: var(--border-primary); height: 8px; border-radius: 4px; overflow: hidden; }
.active-plan .progress-bar-fill { height: 100%; background: var(--accent-gold); border-radius: 4px; transition: width 0.5s ease-in-out; }
.active-plan .sub-footer { text-align: center; }
.manage-sub-btn {
    background: transparent; border: 1px solid var(--border-primary); color: var(--text-secondary);
    padding: 10px 20px; border-radius: var(--border-radius-btn); text-decoration: none;
    font-weight: 600; transition: var(--transition-smooth); display: inline-block;
}
.manage-sub-btn:hover { background: var(--bg-primary); color: var(--text-primary); border-color: var(--text-secondary); }


/* --- SEZIONE SICUREZZA --- */
.security-info {
    text-align: center;
    margin-top: 3rem;
    padding: 1.5rem;
    background: rgba(129, 161, 193, 0.05);
    border-radius: 12px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.security-info i.fa-lock {
    font-size: 2.5rem;
    color: var(--accent-success);
}
.security-info .security-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: left;
}
.security-info .security-text strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.pay-buttons button i.fab {
    font-size: 1.5rem; /* Ensure brand icons have consistent size */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- RESPONSIVE DESIGN (INVARIATO) --- */
@media (max-width: 900px) {
    .plans-wrapper { flex-direction: column; align-items: center; gap: 2rem; }
    .plan-card { max-width: 450px; flex: 1 1 100%; }
    .plan-card.pro::before { top: 18px; right: -42px; }
    .plan-price.annual .price-main { font-size: 2rem; }
    .subscription-premium-box.active-plan { padding: 1.5rem 1rem; }
    .security-info {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .security-info .security-text {
        text-align: center;
    }
}
@media (max-width: 600px) {
    .dashboard-main .page-header h1 { font-size: 2rem; }
    .dashboard-main .page-header p { font-size: 1rem; }
    .plan-card { padding: 2rem 1.5rem; }
    .toggle-btn { flex-grow: 1; text-align: center; padding: 8px 10px; }
    .subscription-premium-box.active-plan { padding: 1.5rem 1rem; }
    .security-info {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .security-info .security-text {
        text-align: center;
    }
    .price-main { font-size: 2.8rem; }
    .price-decimal { font-size: 1.4rem; }
    .price-currency { font-size: 1.2rem; }
}
