/* ========================================
   SUBSCRIPTION PLANS — PROFESSIONAL REDESIGN
   ======================================== */

/* ---- Billing Toggle ---- */
.billing-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 24px 0 8px;
}

.billing-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--neutral-500);
    transition: color 0.3s;
    cursor: pointer;
}

.billing-label.active {
    color: var(--neutral-900);
}

.billing-toggle {
    position: relative;
    width: 52px;
    height: 28px;
    cursor: pointer;
}

.billing-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.billing-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--neutral-300);
    border-radius: 28px;
    transition: background 0.3s;
}

.billing-toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.billing-toggle input:checked + .billing-toggle-slider {
    background: var(--primary-600, #2563eb);
}

.billing-toggle input:checked + .billing-toggle-slider::before {
    transform: translateX(24px);
}

.billing-save-badge {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #15803d;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* ---- Plans Grid ---- */
.subscription-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 0 4px;
    align-items: start;
}

/* ---- Card ---- */
.subscription-card {
    background: white;
    padding: 32px 28px 28px;
    border-radius: 16px;
    border: 1px solid var(--neutral-200, #e5e7eb);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: visible;
}

.subscription-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.1);
}

/* ---- Plan Icon ---- */
.plan-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.plan-icon-basic {
    background: linear-gradient(135deg, #f0f4ff, #dbeafe);
    color: #3b82f6;
}

.plan-icon-standard {
    background: linear-gradient(135deg, #eff6ff, #bfdbfe);
    color: #2563eb;
}

.plan-icon-premium {
    background: linear-gradient(135deg, #faf5ff, #e9d5ff);
    color: #7c3aed;
}

/* ---- Plan Title & Description ---- */
.plan-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--neutral-900, #111827);
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.plan-desc {
    color: var(--neutral-500, #6b7280);
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* ---- Pricing ---- */
.plan-pricing {
    margin-bottom: 20px;
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.plan-currency {
    font-size: 15px;
    font-weight: 600;
    color: var(--neutral-500, #6b7280);
    align-self: flex-start;
    margin-top: 6px;
}

.plan-amount {
    font-size: 36px;
    font-weight: 800;
    color: var(--neutral-900, #111827);
    letter-spacing: -1px;
    line-height: 1;
}

.plan-period {
    font-size: 14px;
    color: var(--neutral-400, #9ca3af);
    font-weight: 500;
    margin-top: 2px;
}

.plan-yearly-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.plan-original-price {
    font-size: 13px;
    color: var(--neutral-400, #9ca3af);
    text-decoration: line-through;
}

.plan-savings {
    font-size: 12px;
    font-weight: 700;
    color: #15803d;
    background: #dcfce7;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ---- Divider ---- */
.plan-divider {
    height: 1px;
    background: var(--neutral-100, #f3f4f6);
    margin-bottom: 20px;
}

/* ---- Features ---- */
.plan-features {
    margin-bottom: 28px;
    padding-left: 0;
    list-style: none;
    flex-grow: 1;
}

.plan-features li {
    font-size: 14px;
    color: var(--neutral-600, #4b5563);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    line-height: 1.4;
}

.feature-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    background: #dcfce7;
    color: #16a34a;
    font-size: 12px;
    font-weight: 700;
    margin-right: 10px;
}

/* ---- Buttons ---- */
.plan-btn {
    width: 100%;
    padding: 13px 20px;
    border-radius: 10px;
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.2px;
    text-align: center;
}

.plan-btn-basic {
    background: var(--neutral-100, #f3f4f6);
    color: var(--neutral-700, #374151);
    border: 1px solid var(--neutral-200, #e5e7eb);
}

.plan-btn-basic:hover {
    background: var(--neutral-200, #e5e7eb);
}

.plan-btn-standard {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.plan-btn-standard:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
    transform: translateY(-1px);
}

.plan-btn-premium {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.plan-btn-premium:hover {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
    transform: translateY(-1px);
}

/* Current plan button state */
.plan-btn.btn-current {
    background: var(--neutral-100, #f3f4f6) !important;
    color: var(--neutral-400, #9ca3af) !important;
    box-shadow: none !important;
    cursor: default;
    border: 1px solid var(--neutral-200, #e5e7eb) !important;
}

.plan-btn.btn-current:hover {
    transform: none !important;
}

/* Subscribe-to-keep state (trial) */
.plan-btn.btn-subscribe-keep {
    background: linear-gradient(135deg, #16a34a, #15803d) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35) !important;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35); }
    50% { box-shadow: 0 4px 24px rgba(22, 163, 74, 0.55); }
}

/* ---- Standard Plan — Highlighted ---- */
.standard-plan {
    border: 2px solid var(--primary-500, #3b82f6);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.12);
    z-index: 1;
}

.standard-plan:hover {
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.18);
}

.standard-plan .plan-title {
    color: #1d4ed8;
}

.standard-plan .plan-amount {
    color: #1d4ed8;
}

.standard-plan .feature-check {
    background: #dbeafe;
    color: #2563eb;
}

.popular-tag {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* ---- Premium Plan ---- */
.premium-plan .plan-title {
    color: #6d28d9;
}

.premium-plan .plan-amount {
    color: #6d28d9;
}

.premium-plan .feature-check {
    background: #ede9fe;
    color: #7c3aed;
}

/* ---- Active Plan Card Highlight ---- */
.subscription-card.active-plan-card {
    box-shadow: 0 0 0 2px #16a34a, 0 8px 30px rgba(22, 163, 74, 0.12);
}

.subscription-card.active-plan-card::after {
    content: 'CURRENT';
    position: absolute;
    top: 12px;
    right: 12px;
    background: #dcfce7;
    color: #15803d;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

/* ========================================
   DARK MODE OVERRIDES
   ======================================== */

[data-theme="dark"] .billing-label {
    color: #64748b;
}

[data-theme="dark"] .billing-label.active {
    color: #f1f5f9;
}

[data-theme="dark"] .billing-toggle-slider {
    background: #475569;
}

[data-theme="dark"] .billing-save-badge {
    background: linear-gradient(135deg, #064e3b, #065f46);
    color: #6ee7b7;
}

[data-theme="dark"] .subscription-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .subscription-card:hover {
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .plan-icon-basic {
    background: linear-gradient(135deg, #1e3a5f, #1e40af33);
    color: #60a5fa;
}

[data-theme="dark"] .plan-icon-standard {
    background: linear-gradient(135deg, #1e3a8a33, #1d4ed833);
    color: #3b82f6;
}

[data-theme="dark"] .plan-icon-premium {
    background: linear-gradient(135deg, #4c1d9533, #6d28d933);
    color: #a78bfa;
}

[data-theme="dark"] .plan-title {
    color: #f1f5f9;
}

[data-theme="dark"] .plan-desc {
    color: #94a3b8;
}

[data-theme="dark"] .plan-currency {
    color: #94a3b8;
}

[data-theme="dark"] .plan-amount {
    color: #f1f5f9;
}

[data-theme="dark"] .plan-period {
    color: #64748b;
}

[data-theme="dark"] .plan-original-price {
    color: #64748b;
}

[data-theme="dark"] .plan-savings {
    background: #064e3b;
    color: #6ee7b7;
}

[data-theme="dark"] .plan-divider {
    background: #334155;
}

[data-theme="dark"] .plan-features li {
    color: #cbd5e1;
}

[data-theme="dark"] .feature-check {
    background: #064e3b;
    color: #34d399;
}

[data-theme="dark"] .plan-btn-basic {
    background: #334155;
    color: #e2e8f0;
    border-color: #475569;
}

[data-theme="dark"] .plan-btn-basic:hover {
    background: #475569;
}

[data-theme="dark"] .standard-plan {
    border-color: #3b82f6;
    background: rgba(30, 58, 138, 0.15);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .standard-plan .plan-title,
[data-theme="dark"] .standard-plan .plan-amount {
    color: #60a5fa;
}

[data-theme="dark"] .standard-plan .feature-check {
    background: #1e3a8a;
    color: #60a5fa;
}

[data-theme="dark"] .premium-plan .plan-title,
[data-theme="dark"] .premium-plan .plan-amount {
    color: #c084fc;
}

[data-theme="dark"] .premium-plan .feature-check {
    background: #4c1d95;
    color: #c084fc;
}

[data-theme="dark"] .popular-tag {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

[data-theme="dark"] .subscription-card.active-plan-card {
    box-shadow: 0 0 0 2px #22c55e, 0 8px 30px rgba(34, 197, 94, 0.1);
}

[data-theme="dark"] .subscription-card.active-plan-card::after {
    background: #064e3b;
    color: #6ee7b7;
}

[data-theme="dark"] .plan-btn.btn-current {
    background: #334155 !important;
    color: #64748b !important;
    border-color: #475569 !important;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .subscription-plans-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .subscription-card {
        padding: 24px 20px 20px;
    }

    .standard-plan {
        order: -1;
    }

    .plan-amount {
        font-size: 30px;
    }

    .billing-toggle-wrapper {
        flex-wrap: wrap;
        gap: 8px;
    }

    .billing-save-badge {
        margin-top: 4px;
    }
}
