:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --summary-bg: #1e293b;
    /* Dark sidebar for summary */
    --summary-text: #f1f5f9;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --error-color: #ef4444;
    --font-family: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.main-container {
    display: flex;
    min-height: 100vh;
    flex-direction: row;
}

/* Left Section: Payment Form */
.payment-section {
    flex: 1.2;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    position: relative;
}

.form-container {
    width: 100%;
    max-width: 480px;
}

.brand {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #0f172a;
    letter-spacing: -1px;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 40px;
    font-size: 1.1rem;
    line-height: 1.5;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    color: #334155;
}

input,
.stripe-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.stripe-input {
    padding-top: 14px;
    /* Adjustment for Stripe iframe */
    padding-bottom: 14px;
}

input:focus,
.stripe-input--focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.pay-button {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.pay-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
}

.pay-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.security-badges {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.error-message {
    color: var(--error-color);
    font-size: 0.9rem;
    margin-top: 6px;
    min-height: 20px;
}

/* Right Section: Summary */
.summary-section {
    flex: 0.8;
    background: var(--summary-bg);
    color: var(--summary-text);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Abstract Background Shapes for Summary */
.summary-section::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(30, 41, 59, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.summary-content {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 10;
}

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

.order-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.order-id {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #94a3b8;
}

.product-card {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.product-image {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.product-details h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.product-details p {
    color: #94a3b8;
    font-size: 0.9rem;
}

.line-items {
    margin-bottom: 40px;
}

.item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    color: #cbd5e1;
    font-size: 1rem;
}

.item.total {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 700;
    color: white;
    font-size: 1.4rem;
    align-items: baseline;
}

.item.total small {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 400;
    margin-left: 5px;
}

.guarantee-box {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
}

.guarantee-box .icon {
    font-size: 1.5rem;
}

.guarantee-box .text p {
    color: #94a3b8;
    margin-top: 4px;
    line-height: 1.4;
}

/* Spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none;
}

/* Mobile & Responsive */
.header-mobile {
    display: none;
}

@media (max-width: 900px) {
    .main-container {
        flex-direction: column;
    }

    .summary-section {
        padding: 40px 20px;
        min-height: auto;
    }

    .payment-section {
        padding: 40px 20px;
        border-top-left-radius: 30px;
        border-top-right-radius: 30px;
        margin-top: -30px;
        /* Overlap effect */
    }

    .summary-section::before {
        display: none;
    }
}

/* Tooltip CVC */
.cvc-tooltip-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.info-icon {
    background: #e2e8f0;
    color: #64748b;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    font-family: serif;
    font-style: italic;
    transition: background 0.3s;
}

.cvc-tooltip-container:hover .info-icon {
    background: #cbd5e1;
    color: #334155;
}

.cvc-tooltip {
    visibility: hidden;
    opacity: 0;
    width: 200px;
    background-color: #1e293b;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 10px;
    position: absolute;
    z-index: 10;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    font-weight: 400;
    transition: opacity 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cvc-tooltip-container:hover .cvc-tooltip {
    visibility: visible;
    opacity: 1;
}

.cvc-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}

.card-back-icon {
    width: 100%;
    height: 40px;
    background: #dadce0;
    border-radius: 4px;
    margin-top: 8px;
    position: relative;
}

.magnetic-strip {
    width: 100%;
    height: 10px;
    background: #475569;
    position: absolute;
    top: 5px;
}

.cvc-box {
    position: absolute;
    right: 10px;
    top: 18px;
    background: white;
    color: #000;
    padding: 1px 4px;
    font-size: 9px;
    border: 1px solid #94a3b8;
}