/* ===== Checkout Page Styles ===== */

:root {
    --checkout-primary: #2563eb;
    --checkout-primary-dark: #1d4ed8;
    --checkout-success: #10b981;
    --checkout-warning: #f59e0b;
    --checkout-danger: #ef4444;
    --checkout-gray-50: #f9fafb;
    --checkout-gray-100: #f3f4f6;
    --checkout-gray-200: #e5e7eb;
    --checkout-gray-300: #d1d5db;
    --checkout-gray-500: #6b7280;
    --checkout-gray-700: #374151;
    --checkout-gray-900: #111827;
}

.checkout-container {
    min-height: 100vh;
    padding: 80px 20px 60px;
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 50%, #f8fafc 100%);
}

/* Header */
.checkout-header {
    text-align: center;
    margin-bottom: 40px;
}

.checkout-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--checkout-gray-900);
    margin-bottom: 12px;
}

.checkout-subtitle {
    font-size: 1.1rem;
    color: var(--checkout-gray-500);
}

/* Navbar user greeting */
.user-greeting {
    color: var(--checkout-gray-700);
    font-size: 0.95rem;
}

.user-greeting strong {
    color: var(--checkout-primary);
}

/* ===== Billing Toggle ===== */
.billing-toggle {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 48px;
    background: var(--checkout-gray-100);
    padding: 6px;
    border-radius: 12px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.toggle-btn {
    padding: 12px 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--checkout-gray-500);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-btn:hover {
    color: var(--checkout-gray-700);
}

.toggle-btn.active {
    background: white;
    color: var(--checkout-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.discount-badge {
    background: var(--checkout-success);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ===== Plans Grid ===== */
.plans-wrapper {
    margin-bottom: 48px;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.plans-grid.hidden {
    display: none;
}

/* ===== Plan Card ===== */
.plan-card {
    background: white;
    border: 2px solid var(--checkout-gray-200);
    border-radius: 16px;
    padding: 32px 24px;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.plan-card:hover {
    border-color: var(--checkout-primary);
    box-shadow: 0 12px 40px rgba(37, 99, 235, 0.12);
    transform: translateY(-4px);
}

.plan-card.selected {
    border-color: var(--checkout-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15), 0 12px 40px rgba(37, 99, 235, 0.15);
}

.plan-card.featured {
    border-color: var(--checkout-primary);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.03) 0%, rgba(16, 185, 129, 0.03) 100%);
    transform: scale(1.02);
}

.plan-card.featured:hover {
    transform: scale(1.02) translateY(-4px);
}

/* Popular Badge */
.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--checkout-primary) 0%, #7c3aed 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Plan Header */
.plan-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--checkout-gray-200);
}

.plan-name {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--checkout-primary);
    margin-bottom: 16px;
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
    margin-bottom: 8px;
}

.plan-price .currency {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--checkout-gray-700);
}

.plan-price .amount {
    font-size: 3rem;
    font-weight: 800;
    color: var(--checkout-gray-900);
    line-height: 1;
}

.plan-price .period {
    font-size: 1rem;
    color: var(--checkout-gray-500);
    font-weight: 500;
}

.plan-price.custom .amount {
    font-size: 1.5rem;
    color: var(--checkout-gray-700);
}

.plan-desc {
    font-size: 0.9rem;
    color: var(--checkout-gray-500);
    margin: 0;
}

/* Savings Tag */
.savings-tag {
    margin-top: 12px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
}

.savings-tag span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--checkout-success);
}

/* Plan Features */
.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    flex: 1;
}

.plan-features li {
    padding: 10px 0;
    color: var(--checkout-gray-700);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--checkout-gray-100);
}

.plan-features li:last-child {
    border-bottom: none;
}

.plan-features li::before {
    content: '';
    width: 18px;
    height: 18px;
    background: var(--checkout-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

/* Select Plan Button */
.btn-select-plan {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--checkout-primary) 0%, var(--checkout-primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-select-plan:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.btn-select-plan.secondary {
    background: white;
    color: var(--checkout-primary);
    border: 2px solid var(--checkout-primary);
}

.btn-select-plan.secondary:hover {
    background: var(--checkout-primary);
    color: white;
}

.plan-card.selected .btn-select-plan {
    background: var(--checkout-success);
}

/* ===== Checkout Box ===== */
.checkout-box {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    max-width: 600px;
    margin: 0 auto 48px;
    border: 1px solid var(--checkout-gray-200);
}

.checkout-summary {
    background: var(--checkout-gray-50);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 32px;
}

.checkout-summary h2 {
    margin: 0 0 20px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--checkout-gray-900);
}

.summary-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--checkout-gray-200);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item span {
    color: var(--checkout-gray-500);
}

.summary-item strong {
    color: var(--checkout-gray-900);
    font-weight: 600;
}

/* Checkout Form */
.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--checkout-gray-700);
}

.form-group input {
    padding: 14px 16px;
    border: 2px solid var(--checkout-gray-200);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: var(--checkout-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: var(--checkout-gray-300);
}

.form-error {
    color: var(--checkout-danger);
    font-size: 0.85rem;
    margin-top: 6px;
    display: none;
}

/* Terms */
.terms-check {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
    padding: 16px;
    background: var(--checkout-gray-50);
    border-radius: 10px;
}

.terms-check input[type='checkbox'] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--checkout-primary);
}

.terms-check label {
    flex: 1;
    font-size: 0.9rem;
    color: var(--checkout-gray-500);
    line-height: 1.5;
}

.terms-check a {
    color: var(--checkout-primary);
    text-decoration: none;
    font-weight: 500;
}

.terms-check a:hover {
    text-decoration: underline;
}

/* Checkout Button */
.btn-checkout {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--checkout-primary) 0%, var(--checkout-primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-checkout:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

.btn-checkout:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    animation: spin 1s linear infinite;
}

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

/* Form Message */
.form-message {
    padding: 14px 16px;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--checkout-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.form-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--checkout-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.form-message.info {
    background: rgba(37, 99, 235, 0.1);
    color: var(--checkout-primary);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

/* Secure Badge */
.secure-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--checkout-gray-500);
    font-size: 0.85rem;
    margin-top: 8px;
}

.secure-badge svg {
    color: var(--checkout-success);
}

/* ===== Trust Section ===== */
.trust-section {
    display: flex;
    justify-content: center;
    gap: 48px;
    padding: 32px 0;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--checkout-gray-500);
    font-size: 0.95rem;
    font-weight: 500;
}

.trust-item svg {
    color: var(--checkout-success);
}

/* ===== Footer Simple ===== */
.footer-simple {
    background: transparent;
    padding: 24px 0;
    text-align: center;
}

.footer-simple p {
    color: var(--checkout-gray-500);
    font-size: 0.9rem;
    margin: 0;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .plans-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .plan-card.featured {
        transform: none;
    }

    .plan-card.featured:hover {
        transform: translateY(-4px);
    }
}

@media (max-width: 768px) {
    .checkout-container {
        padding: 60px 16px 40px;
    }

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

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

    .toggle-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        flex: 1;
        justify-content: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .checkout-box {
        padding: 24px;
    }

    .trust-section {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }

    .plan-price .amount {
        font-size: 2.5rem;
    }
}

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

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

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

    .plan-price .amount {
        font-size: 2rem;
    }

    .checkout-box {
        padding: 20px;
    }

    .checkout-summary {
        padding: 16px;
    }

    .toggle-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .discount-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}
