/* Modern, lightweight styling for the payment form */
:root {
    --bg: #f4f7fb;
    --bg-accent: #e9eefc;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-strong: #ffffff;
    --text: #172033;
    --muted: #5f6b85;
    --border: rgba(100, 116, 139, 0.18);
    --primary: #6b46c1;
    --primary-strong: #553c9a;
    --primary-soft: rgba(107, 70, 193, 0.12);
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(107, 70, 193, 0.14), transparent 34%),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.10), transparent 30%),
        linear-gradient(180deg, #fbfcff 0%, var(--bg) 100%);
    padding: 32px 16px 48px;
}

.page-shell {
    width: min(760px, 100%);
    margin: 0 auto;
}

.page-header {
    margin-bottom: 22px;
    padding: 8px 4px;
}

.page-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 8px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}

h2 {
    margin: 0 0 8px;
    font-size: clamp(1.9rem, 3vw, 2.45rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.page-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.6;
    max-width: 60ch;
}

form {
    display: grid;
    gap: 18px;
}

.section {
    background: var(--surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 22px;
    box-shadow: var(--shadow);
}

.action-section {
    margin-top: 20px;
}

.section h3 {
    margin: 0 0 18px;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

input,
select,
button {
    font: inherit;
}

input,
select {
    width: 100%;
    margin-bottom: 16px;
    padding: 13px 14px;
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

input::placeholder {
    color: #94a3b8;
}

input:focus,
select:focus,
button:focus-visible {
    outline: none;
    border-color: rgba(107, 70, 193, 0.65);
    box-shadow: 0 0 0 4px rgba(107, 70, 193, 0.14);
}

input:hover,
select:hover {
    border-color: rgba(107, 70, 193, 0.35);
}

.exp-group,
.row,
.phone-option,
.cvv-row,
.toggle-row {
    display: flex;
    gap: 12px;
}

.exp-group input {
    width: 50%;
}

.row > * {
    flex: 1;
}

.cvv-row,
.toggle-row,
.phone-option {
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.cvv-row input[type="checkbox"],
.toggle-row input[type="checkbox"],
.phone-option input[type="radio"] {
    width: auto;
    margin: 0;
    accent-color: var(--primary);
}

.cvv-row label,
.toggle-row label,
.phone-option label {
    display: inline;
    margin: 0;
    color: var(--text);
    font-weight: 600;
}

#cc-csc {
    width: 110px;
    display: none;
    margin-bottom: 0;
}

#address-section.hidden {
    display: none;
}

.phone-hint {
    font-size: 0.84rem;
    color: var(--primary);
    margin-top: -6px;
    margin-bottom: 0;
}

button {
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 14px 22px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, opacity 160ms ease;
}

button[type="submit"] {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    box-shadow: 0 16px 32px rgba(107, 70, 193, 0.26);
}

button[type="submit"]:hover {
    background: linear-gradient(135deg, var(--primary-strong), #6d28d9);
    transform: translateY(-1px);
}

#checkout-btn {
    background: linear-gradient(135deg, #111827, #334155);
    color: #fff;
}

#checkout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}

button:disabled {
    cursor: wait;
    opacity: 0.75;
    transform: none;
}

@media (max-width: 640px) {
    body {
        padding: 18px 12px 32px;
    }

    .section {
        padding: 18px;
        border-radius: 20px;
    }

    .exp-group,
    .row,
    .phone-option {
        flex-direction: column;
        gap: 0;
    }

    .exp-group input {
        width: 100%;
    }
}
