/* CHECKOUT PAGE SPECIFIC STYLES */

.checkout-container {
    padding: 120px 5% 80px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.checkout-header {
    text-align: center;
    margin-bottom: 50px;
}

body {
    background-color: var(--bg-secondary) !important;
}

.text-gradient {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.checkout-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
}

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

.checkout-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 40px;
    align-items: stretch;
    /* Modified from start to stretch for equal height */
}

/* Order Summary */
.order-summary {
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.order-summary.plan-starter {
    border-color: rgba(0, 229, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.1);
}

.order-summary.plan-basic {
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.1);
}

.order-summary.plan-premium {
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.1);
}

.summary-header h2 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.order-summary .pricing-card {
    border-radius: 18px;
    margin-bottom: 24px;
    padding: 0;
    box-shadow: 0 8px 25px var(--card-glow, rgba(0, 229, 255, 0.15));
}

.order-summary .card-header-blob::after {
    background: rgba(16, 22, 40, 0.98);
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #f3f4f6;
    font-size: 0.9rem;
    line-height: 1.4;
}

.pricing-features li.muted {
    opacity: 0.45;
}

/* Checkout Form Wrapper */
.checkout-form-wrapper {
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Stretch equally */
}

.form-section-title {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 25px;
    font-weight: 600;
}

.mt-4 {
    margin-top: 40px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    color: #f3f4f6;
    /* Better contrast */
    font-size: 0.85rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Soft gray border */
    border-radius: 8px;
    padding: 14px 16px;
    color: #f3f4f6;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9ca3af;
    /* High contrast placeholder */
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    /* Accent only on focus */
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}

/* Payment Methods */
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 35px;
}

.payment-method-card {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 16px;
    position: relative;
}

.payment-method-card:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.02);
}

.payment-method-card.active {
    border-color: var(--accent);
    background: rgba(0, 229, 255, 0.04);
}

.payment-method-card input {
    display: none;
}

.method-icon {
    font-size: 1.6rem;
    color: #9ca3af;
    transition: color 0.3s ease;
}

.payment-method-card.active .method-icon {
    color: var(--accent);
}

.method-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    /* Pushes radio indicator right */
}

.method-name {
    font-weight: 600;
    color: #f3f4f6;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.method-desc {
    color: #9ca3af;
    font-size: 0.8rem;
    margin-top: 3px;
}

.radio-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.radio-indicator::after {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    transform: scale(0);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.payment-method-card.active .radio-indicator {
    border-color: var(--accent);
}

.payment-method-card.active .radio-indicator::after {
    transform: scale(1);
}

.payhere-logo {
    height: 18px;
    opacity: 0.9;
}

/* Submit Button */
.checkout-submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.2);
    margin-top: auto;
}

.checkout-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.4);
    background: #00cce5;
}

/* Plan Specific Theme Variations */
.checkout-grid.plan-starter .checkout-submit-btn {
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
}

.checkout-grid.plan-starter .checkout-submit-btn:hover {
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.5);
    filter: brightness(1.1);
}

.checkout-grid.plan-starter .payment-method-card.active {
    border-color: #00e5ff;
    background: rgba(0, 229, 255, 0.05);
}

.checkout-grid.plan-starter .payment-method-card.active .method-icon,
.checkout-grid.plan-starter .payment-method-card.active .radio-indicator {
    color: #00e5ff;
    border-color: #00e5ff;
}

.checkout-grid.plan-starter .radio-indicator::after {
    background: #00e5ff;
}

.checkout-grid.plan-basic .checkout-submit-btn {
    background: linear-gradient(135deg, #a855f7, #6d28d9);
    color: #fff;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.checkout-grid.plan-basic .checkout-submit-btn:hover {
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
    filter: brightness(1.1);
}

.checkout-grid.plan-basic .payment-method-card.active {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.05);
}

.checkout-grid.plan-basic .payment-method-card.active .method-icon,
.checkout-grid.plan-basic .payment-method-card.active .radio-indicator {
    color: #a855f7;
    border-color: #a855f7;
}

.checkout-grid.plan-basic .radio-indicator::after {
    background: #a855f7;
}

.checkout-grid.plan-premium .checkout-submit-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.checkout-grid.plan-premium .checkout-submit-btn:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
    filter: brightness(1.1);
}

.checkout-grid.plan-premium .payment-method-card.active {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.checkout-grid.plan-premium .payment-method-card.active .method-icon,
.checkout-grid.plan-premium .payment-method-card.active .radio-indicator {
    color: #f59e0b;
    border-color: #f59e0b;
}

.checkout-grid.plan-premium .radio-indicator::after {
    background: #f59e0b;
}

.secure-checkout-text {
    text-align: center;
    margin-top: 15px;
    color: #9ca3af;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.secure-checkout-text i {
    color: #4ade80;
}

/* Modal */
.checkout-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.checkout-modal.active {
    opacity: 1;
    pointer-events: all;
}

.checkout-modal-content {
    background: var(--gradient-card);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 20px;
    padding: 24px 28px;
    max-width: 480px;
    width: 92%;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.4s ease;
    max-height: 94vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.checkout-modal.active .checkout-modal-content {
    transform: translateY(0);
}

.success-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.checkmark {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: block;
    stroke-width: 4;
    stroke: #4ade80;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px rgba(74, 222, 128, 0);
}

.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 4;
    stroke-miterlimit: 10;
    stroke: #4ade80;
    fill: none;
}

.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
}

/* Animate only when modal is active */
.checkout-modal.active .checkmark__circle {
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkout-modal.active .checkmark__check {
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

.checkout-modal.active .checkmark {
    animation: fill 0.4s ease-in-out 0.4s forwards, scale 0.3s ease-in-out 0.7s both;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes scale {

    0%,
    100% {
        transform: none;
    }

    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 35px rgba(74, 222, 128, 0.1);
    }
}

.checkout-modal-content h2 {
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 1.3rem;
}

.checkout-modal-content p {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-bottom: 12px;
}

/* Modal Receipt Box */
.modal-receipt-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 18px;
    margin: 12px 0;
    text-align: left;
    font-size: 0.82rem;
}

.receipt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.receipt-logo {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
}

.receipt-badge {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    color: #d1d5db;
}

.receipt-label {
    color: #9ca3af;
    font-size: 0.78rem;
}

.receipt-val {
    font-weight: 600;
    color: #f3f4f6;
    word-break: break-all;
    text-align: right;
    max-width: 65%;
    font-size: 0.8rem;
}

.receipt-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 6px 0;
}

.receipt-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 2px solid var(--accent);
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
}

.receipt-total-price {
    font-size: 1.2rem;
    color: var(--accent);
    font-weight: 800;
}

.receipt-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

.receipt-actions .btn {
    padding: 10px 14px;
    font-size: 0.82rem;
    justify-content: center;
}

.btn-full-width {
    grid-column: span 2;
    width: 100%;
}

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

    .order-summary,
    .checkout-form-wrapper {
        height: auto;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
}