/* ============================================
   CHECKOUT PAGE - REFINED PROFESSIONAL
   ============================================ */

.checkout-section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 3rem 2rem;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ============================================
   HEADER
   ============================================ */

.checkout-header {
    text-align: center;
    margin-bottom: 3rem;
}

.checkout-header h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
    letter-spacing: -0.02em;
}

.checkout-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 400;
}

/* ============================================
   BILLING TOGGLE
   ============================================ */

.billing-toggle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.billing-toggle {
    position: relative;
    display: inline-flex;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 4px;
    gap: 4px;
}

.toggle-option {
    position: relative;
    z-index: 2;
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-option:hover {
    color: var(--text-primary);
}

.toggle-option.active {
    color: white;
}

.toggle-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: rgba(74, 128, 124, 0.15);
    color: var(--teal-mid);
    border-radius: 100px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.toggle-option.active .toggle-badge {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.toggle-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: var(--teal-mid);
    border-radius: 100px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}

/* ============================================
   PLAN CARDS
   ============================================ */

.plan-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.plan-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.plan-pro {
    border-color: var(--teal-mid);
    border-width: 2px;
}

.plan-pro:hover {
    box-shadow: 0 16px 32px rgba(74, 128, 124, 0.15);
}

/* Badges */
.plan-badge-current,
.plan-badge-recommended {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.375rem 1rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.plan-badge-current {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.plan-badge-recommended {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Plan Header */
.plan-header {
    margin-bottom: 2rem;
}

.plan-name {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1rem;
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.price-amount {
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.price-period {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.price-note {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: opacity 0.3s ease;
}

/* Plan Features */
.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.plan-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--text-primary);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.check-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--teal-mid);
}

.plan-free .check-icon {
    color: var(--text-tertiary);
}

/* CTA Button */
.cta-button {
    width: 100%;
    margin-top: 2rem;
    padding: 1rem 2rem;
    background: var(--teal-mid);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-button:hover {
    background: var(--teal-deep);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(74, 128, 124, 0.3);
}

.cta-button:active {
    transform: translateY(0);
}

.cta-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.arrow-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
}

.cta-button:hover .arrow-icon {
    transform: translateX(4px);
}

/* ============================================
   ALREADY PRO MESSAGE
   ============================================ */

.already-pro-message {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-width: 500px;
    margin: 0 auto;
}

.success-icon {
    width: 64px;
    height: 64px;
    color: var(--teal-mid);
    margin-bottom: 1.5rem;
}

.already-pro-message h3 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
}

.already-pro-message p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

.already-pro-message a {
    color: var(--teal-mid);
    font-weight: 600;
}

.already-pro-message a:hover {
    color: var(--teal-deep);
}

/* ============================================
   LOADING OVERLAY
   ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    margin-top: 1.5rem;
    color: white;
    font-size: 1rem;
    font-weight: 500;
}

/* ============================================
   DARK THEME
   ============================================ */

[data-theme="dark"] .toggle-slider {
    background: var(--teal-mid);
}

[data-theme="dark"] .toggle-badge {
    background: rgba(74, 128, 124, 0.2);
}

[data-theme="dark"] .plan-card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .plan-pro:hover {
    box-shadow: 0 16px 32px rgba(74, 128, 124, 0.25);
}

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

@media (max-width: 768px) {
    .checkout-section {
        padding: 2rem 1.5rem;
    }

    .checkout-header h1 {
        font-size: 2rem;
    }

    .checkout-subtitle {
        font-size: 1rem;
    }

    .billing-toggle {
        width: 100%;
        max-width: 400px;
    }

    .plan-cards {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .plan-card {
        padding: 1.5rem;
    }

    .price-amount {
        font-size: 2.25rem;
    }

    .toggle-option {
        flex: 1;
        justify-content: center;
        padding: 0.625rem 1rem;
    }
}

@media (max-width: 480px) {
    .checkout-header h1 {
        font-size: 1.75rem;
    }

    .toggle-option {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }

    .toggle-badge {
        font-size: 0.625rem;
        padding: 0.0625rem 0.375rem;
    }
}
