/* ── Page wrapper ──────────────────────────────────────────────────── */
.checkout-page {
    min-height: 80vh;
    padding: 3rem 1.5rem;
    background: var(--bg);
}

/* ── Two-column layout ─────────────────────────────────────────────── */
.checkout-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    max-width: 960px;
    margin: 0 auto;
}

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

/* ── Order summary — left column ───────────────────────────────────── */
.checkout-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.checkout-plan-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.checkout-plan-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
}

.checkout-plan-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
}

.checkout-plan-service {
    font-size: 0.875rem;
    color: var(--text-2);
}

/* ── Billing cycle toggle ──────────────────────────────────────────── */
.checkout-billing-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.billing-option {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    font-size: 0.875rem;
    cursor: pointer;
    color: var(--text-2);
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: var(--font-body);
}

.billing-option.active {
    border-color: var(--brand);
    background: var(--brand-light);
    color: var(--brand);
    font-weight: 500;
}

.billing-badge {
    background: var(--brand-light);
    color: var(--brand);
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 99px;
    font-weight: 600;
}

/* ── Price display ─────────────────────────────────────────────────── */
.checkout-price-row {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.checkout-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
}

.checkout-price-period {
    font-size: 0.9rem;
    color: var(--text-2);
}

.checkout-plan-meta {
    font-size: 0.85rem;
    color: var(--text-2);
    margin: 0;
}

/* ── Totals breakdown ──────────────────────────────────────────────── */
.checkout-totals {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkout-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-2);
}

.checkout-grand-total {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
}

/* ── Trust indicators ──────────────────────────────────────────────── */
.checkout-trust {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkout-trust li {
    font-size: 0.85rem;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkout-trust i { color: var(--brand); }

/* ── Customer info — right column ──────────────────────────────────── */
.checkout-section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text);
}

.checkout-field-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.checkout-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.checkout-field label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-2);
}

/* Only disabled inputs get not-allowed; enabled (guest) inputs use normal text cursor */
.checkout-field input {
    padding: 0.6rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--surface2);
    color: var(--text);
    font-family: var(--font-body);
    cursor: text;
}

.checkout-field input:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.checkout-field-note {
    font-size: 0.82rem;
    color: var(--text-2);
    margin-bottom: 1.5rem;
}

.checkout-field-note a {
    color: var(--brand);
    text-decoration: none;
}

/* ── Validation ────────────────────────────────────────────────────── */
.checkout-req {
    color: var(--danger, #e53e3e);
    margin-left: 2px;
}

.checkout-input-error {
    border-color: var(--danger, #e53e3e) !important;
}

.checkout-field-error {
    display: block;
    font-size: 0.78rem;
    color: var(--danger, #e53e3e);
    margin-top: 4px;
}

/* ── Pay button ────────────────────────────────────────────────────── */
.checkout-pay-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: background 0.15s ease, opacity 0.15s ease;
    margin-bottom: 1rem;
    font-family: var(--font-body);
}

.checkout-pay-btn:hover:not(:disabled) {
    background: var(--brand-dark);
}

.checkout-pay-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.checkout-legal {
    font-size: 0.78rem;
    color: var(--text-2);
    line-height: 1.6;
    text-align: center;
}

.checkout-legal a {
    color: var(--brand);
    text-decoration: none;
}

/* ── Loading / empty states ────────────────────────────────────────── */
.ds-loading, .ds-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 50vh;
    color: var(--text-2);
    text-align: center;
}

.ds-empty-state i { font-size: 3rem; color: var(--text-3); }
.ds-empty-state h2 { margin: 0; color: var(--text); }

/* ── Primary button (empty state CTA) ─────────────────────────────── */
.ds-btn-primary {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    background: var(--brand);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border: 1.5px solid transparent;
    transition: all .25s cubic-bezier(0.4,0,0.2,1);
}

.ds-btn-primary:hover {
    background: #fff;
    color: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 6px 20px rgba(11,116,209,.18);
    transform: translateY(-1px) scale(1.02);
}

/* ── Alert / error banner ──────────────────────────────────────────── */
.ds-alert {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.9rem;
    border: 1px solid;
}

.ds-alert-danger {
    background: rgba(239, 68, 68, .08);
    color: #dc2626;
    border-color: rgba(239, 68, 68, .25);
}

[data-theme="dark"] .ds-alert-danger {
    background: rgba(239, 68, 68, .12);
    color: #f87171;
    border-color: rgba(239, 68, 68, .30);
}

/* ── Spinners (@keyframes spin is global in app.css) ──────────────── */
.ds-spinner {
    width: 22px; height: 22px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

.ds-spinner-sm { width: 16px; height: 16px; }
