:root {
    --primary: #1a73e8;
    --accent: #fbbc04;
    --success: #16a34a;
    --danger: #b91c1c;
    --text: #1f2937;
    --muted: #6b7280;
    --bg: #f9fafb;
    --surface: #ffffff;
    --border: #e5e7eb;
}

body.modal-open {
    overflow: hidden;
}

.checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.checkout-modal[data-visible="true"] {
    opacity: 1;
    visibility: visible;
}

.checkout-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

.checkout-dialog {
    position: relative;
    background: var(--surface);
    border-radius: 16px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.checkout-modal[data-visible="true"] .checkout-dialog {
    transform: scale(1);
}

.checkout-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.checkout-close:hover {
    background: var(--border);
    color: var(--text);
}

.checkout-dialog header {
    padding: 2rem 2rem 1rem;
    text-align: center;
}

.modal-eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.checkout-dialog h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.modal-subtitle {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 0;
}

#checkoutForm {
    padding: 1rem 2rem 2rem;
    display: grid;
    gap: 1.25rem;
}

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

.form-row label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.form-row input,
.form-row textarea {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-row input:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.branding-options {
    display: grid;
    gap: 0.75rem;
}

.branding-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    cursor: pointer;
}

.branding-option input[type="radio"] {
    accent-color: var(--primary);
}

.payment-hint {
    background: #f0f9ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 0.875rem;
    font-size: 0.9rem;
    color: #1e40af;
}

.form-summary {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    display: grid;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.form-summary p {
    margin: 0;
    display: flex;
    justify-content: space-between;
}

.summary-note {
    font-size: 0.875rem;
    color: var(--muted);
    margin-top: 0.5rem !important;
    font-style: italic;
}

.form-feedback {
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.form-feedback.processing {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    display: block;
}

.form-feedback.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    display: block;
}

.form-feedback.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    display: block;
}

.btn.full-width {
    justify-self: stretch;
    width: 100%;
}

@media (max-width: 640px) {
    .checkout-dialog {
        width: 95%;
        margin: 1rem;
    }

    .checkout-dialog header {
        padding: 1.5rem 1.5rem 1rem;
    }

    #checkoutForm {
        padding: 1rem 1.5rem 1.5rem;
    }
}
