:root {
    --checkout-primary: #ae2828;
    --checkout-dark: #262b2e;
    --checkout-step-bg: #262a2f;
    --checkout-accent: #34b5d7;
    --checkout-gold: #ffc437;
    --checkout-label: #262b2e;
    --checkout-muted: #6c767c;
    --checkout-border: #d2d2d2;
    --checkout-required: #ad175b;
}

* { box-sizing: border-box; }

html {
    overflow-x: hidden;
    max-width: 100%;
}

body.checkout-body {
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    background: #f0f0f0;
    color: #222;
    padding-bottom: 60px;
    overflow-x: hidden;
    max-width: 100%;
    position: relative;
}

.checkout-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    z-index: 1001;
    background: var(--checkout-primary);
    padding: 10px 0;
}

.checkout-header__inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
}

.checkout-header img {
    max-height: 48px;
    width: auto;
}

.checkout-main {
    margin-top: 100px;
    padding: 0 1rem 2rem;
    max-width: 100%;
    overflow-x: hidden;
}

.checkout-container {
    max-width: 1140px;
    margin: 0 auto;
    width: 100%;
}

.checkout-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
    min-width: 0;
    max-width: 100%;
}

@media (min-width: 992px) {
    .checkout-grid {
        grid-template-columns: 2fr 1fr;
        align-items: start;
    }
}

.form-box {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.form-box h1,
.form-box h2,
.form-box h3 {
    color: var(--checkout-label);
    margin-top: 0;
}

.form-box h3 {
    font-size: 1.125rem;
    margin-bottom: 1.25rem;
}

.checkout-field-grid {
    display: grid;
    gap: 0 1rem;
    grid-template-columns: 1fr;
}

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

    .checkout-field-grid .field-full {
        grid-column: 1 / -1;
    }
}

.checkout-field {
    margin-bottom: 1rem;
}

.checkout-field label {
    display: block;
    color: var(--checkout-label);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.checkout-field label .required {
    color: var(--checkout-required);
    text-decoration: none;
}

.checkout-field input,
.checkout-field select,
.checkout-field textarea {
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--checkout-border);
    font-size: 15px;
    font-weight: 400;
    background: transparent;
    padding: 12px;
    border-radius: 8px;
    color: var(--checkout-muted);
}

.checkout-field input[readonly] {
    background: #f8f8f8;
}

#checkout-login-box {
    margin-bottom: 1rem;
    scroll-margin-top: 24px;
}

#checkout-login-box.is-open {
    background: #f5f5f5;
    border: 1px solid var(--checkout-border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 1.5rem;
}

.checkout-login-alert {
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: 6px;
    background: #ffecec;
    border: 1px solid #f5b5b5;
    color: #8a1f1f;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.checkout-field-hint {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.checkout-field-hint.is-error {
    color: #b00020;
}

.checkout-login-toggle {
    background: #ffbf4c40;
    border: none;
    border-radius: 5px;
    padding: 12px 16px;
    width: 100%;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #000;
    cursor: pointer;
    margin-bottom: 0;
    display: block;
    line-height: 1.4;
}

#checkout-login-box.is-open .checkout-login-toggle {
    margin-bottom: 12px;
}

.checkout-login-toggle b {
    font-weight: 700;
}

.checkout-login-toggle__link {
    color: #2f9bff;
    text-decoration: underline;
    font-weight: 600;
}

.checkout-login-panel {
    display: none;
    background: #fff;
    border-radius: 8px;
    padding: 16px;
}

.checkout-login-panel.is-open {
    display: block;
}

.checkout-login-panel .form-message {
    margin-top: 0;
}

.checkout-login-panel .link-button {
    background: none;
    border: none;
    padding: 0;
    color: #2f9bff;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
}

.checkout-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.checkout-mobile-summary {
    display: none;
}

.checkout-back {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 12px 16px;
    color: #222;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    background: #e8e8e8;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.checkout-back::before {
    content: '‹';
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1;
    transform: translateY(-1px);
}

.checkout-back:hover {
    color: var(--checkout-accent);
}

.btn-next,
.btn-prev {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--checkout-accent);
    padding: 12px 25px;
    color: #fff;
    font-size: 19px;
    font-weight: 600;
    border-radius: 25px;
    border: 1px solid #fff;
    cursor: pointer;
    text-decoration: none;
}

.btn-next:disabled,
.btn-prev:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-next--wide {
    width: 100%;
    max-width: 420px;
    justify-content: center;
}

.btn-next--wide::after,
.btn-next--secondary::after,
.checkout-copy-button::after {
    content: none;
}

.btn-next--secondary {
    background: #fff;
    color: var(--checkout-label);
    border: 1px solid var(--checkout-border);
}

.btn-next--secondary:hover {
    background: #f7f7f7;
}

.btn-prev::before {
    content: '←';
    font-size: 1.25rem;
}

.btn-next::after {
    content: '→';
    font-size: 1.25rem;
}

.btn-next.is-loading {
    opacity: 0.85;
    pointer-events: none;
    justify-content: center;
}

.btn-next.is-loading::after {
    content: none;
}

.btn-spinner {
    width: 1.1em;
    height: 1.1em;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: checkout-spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

.checkout-sidebar__intro {
    text-align: center;
    font-weight: 600;
    margin-bottom: 1rem;
}

.checkout-plan-card {
    background-color: var(--checkout-dark);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background-repeat: no-repeat;
    background-position: 25px -60px;
    margin-bottom: 1rem;
}

.checkout-plan-card .stars {
    display: block;
    margin-bottom: 0.5rem;
}

.checkout-plan-card .stars img {
    max-width: 118px;
    height: auto;
}

.checkout-plan-card .badge-label {
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.5rem;
}

.checkout-plan-card h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin: 0.5rem 0;
    line-height: 1.1;
}

.checkout-plan-card h2::before,
.checkout-plan-card h2::after {
    content: "";
    display: block;
    width: min(300px, 100%);
    height: 2px;
    margin: 20px auto;
    background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 50%);
}

.checkout-plan-card .price {
    color: var(--checkout-gold);
    font-size: 30px;
    font-weight: 800;
    margin: 0 0 1.5rem;
}

.checkout-plan-card .info {
    background: rgba(255, 255, 255, 0.5);
    padding: 5px 15px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 25px;
    color: #fff;
}

.checkout-totals {
    background: #fff;
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.checkout-totals__row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 15px;
    color: #747474;
}

.checkout-totals__row--total {
    color: #000;
    font-weight: 800;
    font-size: 16px;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
}

.checkout-totals hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 0.5rem 0;
}

.checkout-steps {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    background: var(--checkout-step-bg);
    z-index: 1002;
    display: flex;
    overflow: hidden;
}

.checkout-step {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 48px;
    color: #6c767c;
    font-size: 16px;
    font-weight: 600;
    clip-path: polygon(0 0, 97% 0%, 100% 50%, 97% 100%, 0 100%, 0% 50%);
}

.checkout-step:not(:first-child) {
    clip-path: polygon(0 0, 97% 0%, 100% 50%, 97% 100%, 0 100%, 3% 50%);
}

.checkout-step:last-child {
    clip-path: polygon(0 0, 100% 0, 100% 50%, 100% 100%, 0 100%, 3% 50%);
}

.checkout-step.is-active {
    background: var(--checkout-accent);
    color: #fff;
}

.checkout-step.is-complete {
    background: #04c758;
    color: #fff;
}

.checkout-step.is-complete .checkout-step__index {
    background: #fff;
    color: #04c758;
}

.checkout-step__index {
    background: #6c767c;
    color: #d3d3d3;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    font-weight: 700;
    flex-shrink: 0;
}

.checkout-step.is-active .checkout-step__index {
    background: #fff;
    color: var(--checkout-accent);
    border: 3px solid var(--checkout-accent);
    box-shadow: 0 0 0 2px #fff;
}

.checkout-step.is-done .checkout-step__index {
    background: #fff;
    color: var(--checkout-step-bg);
}

.checkout-step__label {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .checkout-steps {
        top: 58px;
        bottom: auto;
    }

    .checkout-main {
        margin-top: 120px;
        padding-left: 12px;
        padding-right: 12px;
    }

    #checkout-login-box {
        scroll-margin-top: 130px;
    }

    .form-box {
        padding: 20px 16px;
    }

    .checkout-plan-card--desktop {
        display: none;
    }

    .checkout-step__label {
        font-size: 13px;
    }

    .checkout-step__index {
        width: 23px;
        height: 23px;
        font-size: 14px;
        margin-right: 8px;
    }

    .checkout-body--identify .checkout-actions--desktop,
    .checkout-grid--payment .checkout-actions--desktop {
        display: none;
    }

    .checkout-grid--payment aside .checkout-totals {
        display: none;
    }

    .checkout-mobile-summary {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        z-index: 1003;
        background: #fff;
        border-radius: 12px 12px 0 0;
        border-top: 1px solid #e6e6e6;
        box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.08);
        padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
        overflow-x: hidden;
    }

    .checkout-mobile-summary__rows {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .checkout-mobile-summary__row {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 1rem;
        font-size: 15px;
        color: #747474;
    }

    .checkout-mobile-summary__row--total {
        color: #000;
        font-weight: 800;
        font-size: 16px;
        padding-top: 0.5rem;
        border-top: 1px solid #eee;
    }

    .checkout-mobile-summary__row--total strong {
        font-weight: 800;
    }

    .checkout-mobile-summary:not(.checkout-mobile-summary--totals-only) .checkout-mobile-summary__rows {
        margin-bottom: 10px;
    }

    .checkout-mobile-summary__submit {
        width: 100%;
        justify-content: center;
    }

    .checkout-mobile-summary__submit::after {
        content: none;
    }

    .checkout-mobile-summary__submit.is-loading {
        gap: 10px;
    }

    .checkout-body--identify,
    .checkout-body--payment {
        padding-bottom: 160px;
    }

    .btn-next,
    .btn-prev {
        max-width: 100%;
    }
}

@media (min-width: 769px) {
    .checkout-plan-card--mobile {
        display: none;
    }
}

.payment-methods {
    border: none;
    padding: 0;
    margin-bottom: 1.5rem;
}

.payment-methods legend {
    font-weight: 700;
    font-size: 20px;
    color: #525151;
    margin-bottom: 1rem;
    padding: 0;
}

.payment-methods__options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.payment-method-option {
    cursor: pointer;
    flex: 0 0 auto;
}

.payment-method-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.payment-method-option__box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 80px;
    height: 80px;
    padding: 8px 6px 6px;
    border: 1px solid #b7b7b7;
    border-radius: 5px;
    background-color: #e9e9e9;
    font-size: 13px;
    font-weight: 700;
    color: #525151;
    text-align: center;
    transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.payment-method-option__box img {
    display: block;
    max-width: 36px;
    max-height: 32px;
    width: auto;
    height: auto;
}

.payment-method-option input:checked + .payment-method-option__box {
    border-color: #34b5d7;
    background-color: #fff;
    box-shadow: 0 0 0 2px #34b5d7;
}

.payment-method-option input:focus-visible + .payment-method-option__box {
    outline: 2px solid #34b5d7;
    outline-offset: 2px;
}

.payment-method-option:hover .payment-method-option__box {
    border-color: #34b5d7;
}

.card-fields {
    margin-top: 1rem;
}

.card-fields .inline-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.card-fields .inline-fields--expiry {
    grid-template-columns: 1fr 1fr;
}

.card-fields .address-heading {
    margin: 1.5rem 0 0.25rem;
    font-size: 1.1rem;
}

.card-fields .checkout-field-grid {
    margin-top: 0.75rem;
}

.checkout-legal {
    margin: 1.25rem 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--checkout-muted);
}

.checkout-legal a {
    color: var(--checkout-accent);
}

.buyer-summary {
    background: #f8f8f8;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 14px;
    line-height: 1.6;
}

.form-message {
    margin-top: 1rem;
    color: #444;
}

.form-message.is-error {
    color: #b00020;
}

.errors {
    color: #b00020;
    margin-bottom: 1rem;
    background: #ff000040;
    padding: 12px 16px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
}

.status {
    color: #0a7a2f;
    margin-bottom: 1rem;
    background: #00d08a40;
    padding: 12px 16px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
}

#password-fields {
    margin-top: 0.5rem;
}

.checkout-grid--thank-you {
    align-items: start;
}

.checkout-thank-you {
    overflow: hidden;
}

.checkout-kicker {
    color: var(--checkout-muted);
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 1.5rem;
}

.checkout-thank-you h1 {
    color: var(--checkout-label);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.checkout-thank-you--success h1 {
    color: #04c758;
}

.checkout-thank-you__lead {
    color: var(--checkout-label);
    font-size: 18px;
    line-height: 1.55;
    margin: 0 0 1.5rem;
}

.checkout-payment-panel {
    background: #fff;
    border-radius: 8px;
    padding: 0;
    margin: 0 0 1.5rem;
}

.checkout-payment-panel--pending {
    background: transparent;
}

.checkout-payment-panel__status {
    color: var(--checkout-muted);
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 1rem;
}

.checkout-payment-panel__notice,
.checkout-payment-panel__hint {
    color: var(--checkout-label);
    font-size: 14px;
    line-height: 1.5;
}

.checkout-payment-panel__hint {
    margin: 1rem 0 0;
}

.checkout-pix-qr {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.checkout-pix-qr img {
    width: min(220px, 100%);
    height: auto;
    background: #fff;
    padding: 10px;
}

.pix-copy {
    margin: 1.25rem 0;
}

.pix-copy__code {
    background: #f8f8f8;
    border: 1px solid var(--checkout-border);
    border-radius: 8px;
    color: var(--checkout-label);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.45;
    margin: 0;
    max-height: 120px;
    overflow: auto;
    padding: 1rem;
    word-break: break-all;
}

.pix-copy__actions {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.checkout-copy-button {
    width: 100%;
    max-width: 420px;
    justify-content: center;
}

.pix-copy__feedback {
    color: #0a7a2f;
    font-size: 14px;
    font-weight: 700;
}

.checkout-instructions {
    margin: 1.25rem 0 0;
}

.checkout-instructions h2 {
    color: var(--checkout-label);
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 0.75rem;
}

.checkout-instructions ol {
    margin: 0;
    padding-left: 1.25rem;
}

.checkout-instructions li {
    color: var(--checkout-label);
    font-size: 14px;
    line-height: 1.45;
    margin: 0 0 0.45rem;
}

.checkout-instructions li:last-child {
    margin-bottom: 0;
}

.card-fields {
    scroll-margin-top: 140px;
}

.checkout-thank-you__actions {
    align-items: center;
    justify-content: center;
    margin-top: 1.5rem;
}

.checkout-account-message {
    color: var(--checkout-muted);
    font-size: 15px;
    line-height: 1.5;
}

.checkout-thank-you__aside {
    min-width: 0;
}

.checkout-support {
    background: #fff;
    border-radius: 8px;
    margin-top: 1rem;
    padding: 1.25rem;
}

.checkout-support__highlight {
    color: var(--checkout-accent);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
    margin: 0 0 0.75rem;
}

.checkout-support__text {
    color: var(--checkout-label);
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 0.75rem;
}

.checkout-support__text:last-child {
    margin-bottom: 0;
}

.checkout-support a {
    color: var(--checkout-accent);
    font-weight: 700;
    text-decoration: none;
}

.checkout-support a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .checkout-body--thank-you {
        padding-bottom: 70px;
    }

    .checkout-thank-you h1 {
        font-size: 2rem;
    }
}

@media (max-width: 520px) {
    .checkout-payment-panel {
        padding: 0;
    }
}
