@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-focus: #0ea5e9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent-blue: #0284c7;
    --accent-purple: #4f46e5;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --glow-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
}

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(2, 132, 199, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    overflow-x: hidden;
}

.checkout-container {
    width: 100%;
    max-width: 950px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
}

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

/* Left Panel - Form Details */
.form-panel {
    padding: 3rem 2.5rem;
}

@media (max-width: 480px) {
    .form-panel {
        padding: 2rem 1.5rem;
    }
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.brand-logo svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(to right, var(--accent-blue), var(--accent-purple));
    border-radius: 2px;
}

.form-group-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 480px) {
    .form-group-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.form-group.full-width {
    grid-column: span 2;
}

@media (max-width: 480px) {
    .form-group.full-width {
        grid-column: span 1;
    }
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.3s;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"] {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus {
    border-color: var(--border-focus);
    box-shadow: var(--glow-shadow);
}

input[type="text"]:focus + .input-icon,
input[type="email"]:focus + .input-icon,
input[type="tel"]:focus + .input-icon,
input[type="number"]:focus + .input-icon {
    color: var(--border-focus);
}

/* Card Element wrapper for Stripe */
.stripe-card-wrapper {
    padding: 0.875rem 1rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-height: 46px;
    transition: all 0.3s;
}

.stripe-card-wrapper.focus {
    border-color: var(--border-focus);
    box-shadow: var(--glow-shadow);
}

/* Right Panel - Order Summary & Details */
.summary-panel {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

@media (max-width: 768px) {
    .summary-panel {
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding: 2.5rem;
    }
}

.summary-header {
    margin-bottom: 2.5rem;
}

.summary-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

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

.pricing-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.amount-input-group {
    margin-top: 1rem;
}

.amount-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
}

.currency-symbol {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-blue);
}

input.amount-field {
    width: 100%;
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    padding: 0.5rem 1rem 0.5rem 2.25rem;
    background: transparent;
    border: none;
    border-bottom: 2px dashed var(--border-color);
    border-radius: 0;
    color: var(--accent-blue);
    outline: none;
    transition: border-color 0.3s;
}

input.amount-field:focus {
    border-color: var(--accent-blue);
}

/* Remove arrows for number inputs */
input.amount-field::-webkit-outer-spin-button,
input.amount-field::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input.amount-field {
    -moz-appearance: textfield;
}

.amount-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: block;
}

.summary-details {
    margin-bottom: 2.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 0.9rem;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-secondary);
}

.detail-value {
    font-weight: 500;
}

.secure-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    justify-content: center;
    margin-top: 1.5rem;
}

.secure-notice svg {
    color: var(--accent-green);
    width: 14px;
    height: 14px;
}

/* Button & Loading State */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
    border: none;
    border-radius: 12px;
    padding: 1.1rem;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.2);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: all 0.6s;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Spinner */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -10px;
    margin-top: -10px;
}

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

.btn-text {
    transition: opacity 0.2s;
}

.submit-btn.loading .btn-text {
    opacity: 0;
}

.submit-btn.loading .spinner {
    display: block;
}

/* Status / Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: fadeIn 0.3s ease-out;
}

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

.alert-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.alert-success {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.alert svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}
