/* ============================================
   CHECKOUT — Design System
   Same tokens as the landing for brand consistency
   ============================================ */
:root {
    --dark: #0a0a0a;
    --dark-card: #141414;
    --brown: #3d2b1f;
    --gold: #c8956c;
    --gold-dark: #a0714e;
    --gold-light: #e8c9a8;
    --cream: #faf6f1;
    --cream-dark: #f0e8df;
    --text-dark: #1a1a1a;
    --text-muted: #6b6b6b;
    --text-light: #f5f5f5;
    --text-muted-light: #a0a0a0;
    --border-dark: rgba(200, 149, 108, 0.15);
    --success: #2d8a4e;
    --danger: #c0392b;
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Montserrat', -apple-system, sans-serif;
    --radius: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--cream);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- URGENCY BAR ---- */
.checkout-urgency {
    background: linear-gradient(135deg, var(--dark), var(--dark-card));
    color: var(--gold-light);
    text-align: center;
    padding: 10px 16px;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.checkout-urgency__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.checkout-urgency__inner svg {
    color: var(--gold);
    flex-shrink: 0;
}

/* ---- MAIN LAYOUT ---- */
.checkout-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    flex: 1;
}

@media (min-width: 768px) {
    .checkout-layout {
        grid-template-columns: 1fr 360px;
        gap: 40px;
        padding: 40px 24px;
    }
}

@media (min-width: 1024px) {
    .checkout-layout {
        padding: 48px 32px;
    }
}

/* ---- CHECKOUT MAIN ---- */
.checkout-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ---- PRODUCT BANNER ---- */
.checkout-banner {
    background: linear-gradient(135deg, var(--dark), var(--dark-card));
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.checkout-banner__content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.checkout-banner__avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold);
    flex-shrink: 0;
}

.checkout-banner__title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--text-light);
    line-height: 1.2;
}

.checkout-banner__author {
    font-size: 0.85rem;
    color: var(--gold-light);
    margin-top: 4px;
}

/* ---- PLAN SUMMARY ---- */
.checkout-plan {
    background: #fff;
    border: 2px solid var(--gold);
    border-radius: var(--radius);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.checkout-plan__badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 4px 12px;
    border-radius: 50px;
}

.checkout-plan__desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.checkout-plan__price {
    text-align: right;
    flex-shrink: 0;
}

.checkout-plan__amount {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--brown);
    line-height: 1;
}

.checkout-plan__currency {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 4px;
}

/* ---- SWITCH PLAN ---- */
.checkout-switch {
    text-align: center;
}

.checkout-switch__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px dashed var(--gold);
    color: var(--gold-dark);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

.checkout-switch__btn:hover {
    background: rgba(200, 149, 108, 0.08);
    border-color: var(--gold-dark);
}

.checkout-switch__btn svg {
    color: var(--gold);
}

/* ---- CHECKOUT SECTIONS ---- */
.checkout-section {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(200, 149, 108, 0.1);
}

.checkout-section__title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--brown);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.checkout-section__number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ---- FORM ---- */
.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--brown);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(200, 149, 108, 0.2);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-dark);
    background: var(--cream);
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus {
    border-color: var(--gold);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(200, 149, 108, 0.15);
}

.form-group input::placeholder {
    color: #bbb;
}

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-optional {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ---- PRE-CHECKOUT STATE ---- */
.checkout-pre {
    text-align: center;
}

.btn-continue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px 32px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-continue:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(200, 149, 108, 0.35);
}

.btn-continue:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkout-pre__hint {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---- STRIPE CHECKOUT CONTAINER ---- */
.checkout-stripe-container {
    min-height: 300px;
    border-radius: var(--radius);
    overflow: hidden;
}

/* ---- LOADING STATE ---- */
.checkout-loading {
    text-align: center;
    padding: 48px 20px;
}

.checkout-loading p {
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.checkout-loading__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(200, 149, 108, 0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 0.8s linear infinite;
}

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

/* ---- ERROR STATE ---- */
.checkout-error {
    text-align: center;
    padding: 32px 20px;
    background: rgba(192, 57, 43, 0.05);
    border: 1px solid rgba(192, 57, 43, 0.15);
    border-radius: var(--radius);
}

.checkout-error svg {
    color: var(--danger);
    margin-bottom: 12px;
}

.checkout-error p {
    font-size: 0.9rem;
    color: var(--danger);
    margin-bottom: 16px;
}

.btn-retry {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #fff;
    border: 2px solid var(--danger);
    color: var(--danger);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-retry:hover {
    background: var(--danger);
    color: #fff;
}

/* ---- TRUST BADGES ---- */
.checkout-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    padding: 16px 0;
}

.checkout-trust__item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.checkout-trust__item svg {
    color: var(--gold);
    flex-shrink: 0;
}

/* ---- SIDEBAR ---- */
.checkout-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 768px) {
    .checkout-sidebar {
        position: sticky;
        top: 56px;
        align-self: start;
    }
}

.sidebar-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(200, 149, 108, 0.1);
}

.sidebar-card__title {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--brown);
    margin-bottom: 16px;
}

.sidebar-card__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.sidebar-card__row strong {
    color: var(--brown);
    font-weight: 700;
}

.sidebar-card__divider {
    height: 1px;
    background: rgba(200, 149, 108, 0.15);
    margin: 12px 0;
}

.sidebar-card__row--total {
    font-size: 1rem;
}

.sidebar-card__row--total span {
    font-weight: 600;
    color: var(--brown);
}

.sidebar-card__row--total strong {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--gold-dark);
}

/* ---- SIDEBAR LIST ---- */
.sidebar-card__list {
    list-style: none;
}

.sidebar-card__list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.sidebar-card__list li svg {
    color: var(--gold);
    margin-top: 2px;
    flex-shrink: 0;
}

/* ---- SUPPORT LINK ---- */
.sidebar-card--support {
    background: linear-gradient(135deg, var(--dark), var(--dark-card));
    border-color: var(--border-dark);
}

.sidebar-card--support .sidebar-card__title {
    color: var(--gold-light);
}

.sidebar-support__link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(200, 149, 108, 0.08);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-support__link:hover {
    background: rgba(200, 149, 108, 0.15);
    border-color: var(--gold);
}

.sidebar-support__link svg {
    color: var(--gold);
    flex-shrink: 0;
}

.sidebar-support__link strong {
    display: block;
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.3;
}

.sidebar-support__link span {
    font-size: 0.78rem;
    color: var(--text-muted-light);
}

/* ---- FOOTER ---- */
.checkout-footer {
    background: var(--dark);
    padding: 20px 16px;
    margin-top: auto;
}

.checkout-footer__inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.checkout-footer__inner p {
    font-size: 0.75rem;
    color: var(--text-muted-light);
}

.checkout-footer__badges {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-muted-light);
}

.checkout-footer__badges svg {
    color: var(--gold);
}

/* ---- MOBILE POLISH ---- */
@media (max-width: 479px) {
    .checkout-banner__avatar {
        width: 48px;
        height: 48px;
    }

    .checkout-banner__title {
        font-size: 1.1rem;
    }

    .checkout-plan {
        flex-direction: column;
        text-align: center;
    }

    .checkout-plan__price {
        text-align: center;
    }

    .checkout-section {
        padding: 20px 16px;
    }

    .sidebar-card {
        padding: 20px 16px;
    }
}
