/* ==========================================================================
   Checkout — the details form, the order summary, and the package picker.
   Loaded only on /get-started and /get-started/{slug}.

   Built on the tokens in style.css (--clr-*, --r-*, --shadow-*) so the page
   inherits the site's palette rather than restating it.
   ========================================================================== */

.checkout {
    padding: 3rem 0 4.5rem;
}

/* --------------------------------------------------------------------------
   Layout: form on the left, summary alongside on desktop.

   The summary comes SECOND in the source so a screen reader and a phone both
   reach the fields first — the summary is a reminder, and on a narrow screen
   it belongs under the thing it summarises, not above it.
   -------------------------------------------------------------------------- */
.checkout__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
    align-items: start;
}

@media (min-width: 992px) {
    .checkout__layout {
        grid-template-columns: minmax(0, 1fr) 22rem;
        gap: 2.25rem;
    }
}

.checkout__main {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

/* --------------------------------------------------------------------------
   Form cards
   -------------------------------------------------------------------------- */
.checkoutCard {
    background: var(--clr-cream, #fff);
    border: 1px solid var(--clr-parchment, #e2e8f0);
    border-radius: var(--r-xl, 1rem);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, .06));
    padding: 1.5rem;
    margin: 0;
    min-width: 0;
}

@media (min-width: 576px) {
    .checkoutCard {
        padding: 1.75rem 2rem;
    }
}

.checkoutCard__legend {
    display: flex;
    align-items: center;
    gap: .625rem;
    flex-wrap: wrap;
    float: none;
    width: auto;
    margin: 0 0 1.25rem;
    padding: 0;
    font-family: var(--font-serif, sans-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--clr-bark, #0d1b2a);
}

/* The numbered pip. Cosmetic ordering, so it is hidden from the accessible
   name — the legend text alone reads correctly. */
.checkoutCard__step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: var(--r-full, 50rem);
    background: var(--clr-secondary, #5cb338);
    color: #fff;
    font-size: .9rem;
    font-weight: 700;
    flex: 0 0 auto;
}

.checkoutCard__optional {
    font-family: var(--font-sans, sans-serif);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--clr-stone, #64748b);
    background: var(--clr-linen, #f8fafc);
    border: 1px solid var(--clr-parchment, #e2e8f0);
    border-radius: var(--r-full, 50rem);
    padding: .15rem .6rem;
}

/* --------------------------------------------------------------------------
   Fields
   -------------------------------------------------------------------------- */
.checkoutField + .checkoutField,
.checkoutField__row + .checkoutField {
    margin-top: 1.1rem;
}

.checkoutField__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.1rem;
    margin-top: 1.1rem;
}

@media (min-width: 576px) {
    .checkoutField__row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .checkoutField__row .checkoutField + .checkoutField {
        margin-top: 0;
    }
}

.checkoutField__label {
    display: block;
    margin-bottom: .4rem;
    font-size: .9rem;
    font-weight: 600;
    color: var(--clr-earth, #334155);
}

.checkoutField__req {
    color: var(--clr-terracotta, #ef4444);
}

.checkoutField__optional {
    font-weight: 500;
    font-size: .8rem;
    color: var(--clr-stone, #64748b);
}

.checkoutField__input {
    display: block;
    width: 100%;
    padding: .7rem .9rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--clr-bark, #0d1b2a);
    background: #fff;
    border: 1px solid var(--clr-parchment, #e2e8f0);
    border-radius: var(--r-md, .5rem);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.checkoutField__input:focus {
    outline: none;
    border-color: var(--clr-secondary, #5cb338);
    box-shadow: 0 0 0 3px rgba(92, 179, 56, .18);
}

.checkoutField__input--area {
    resize: vertical;
    min-height: 6rem;
}

.checkoutField__input.is-invalid {
    border-color: var(--clr-terracotta, #ef4444);
}

.checkoutField__input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .18);
}

.checkoutField__hint {
    margin: .4rem 0 0;
    font-size: .82rem;
    color: var(--clr-stone, #64748b);
}

.checkoutField__error {
    margin: .4rem 0 0;
    font-size: .82rem;
    font-weight: 600;
    color: var(--clr-terracotta, #ef4444);
}

/* --------------------------------------------------------------------------
   Order summary
   -------------------------------------------------------------------------- */
.orderSummary {
    background: var(--clr-cream, #fff);
    border: 1px solid var(--clr-parchment, #e2e8f0);
    border-radius: var(--r-xl, 1rem);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, .08));
    padding: 1.5rem;
}

/* Sticky only where there is room to scroll past it. */
@media (min-width: 992px) {
    .checkout__aside {
        position: sticky;
        top: 6rem;
    }
}

.orderSummary__title {
    margin: 0 0 1rem;
    font-family: var(--font-serif, sans-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--clr-bark, #0d1b2a);
}

.orderSummary__item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--clr-parchment, #e2e8f0);
}

.orderSummary__itemName {
    font-weight: 600;
    color: var(--clr-earth, #334155);
}

.orderSummary__itemPrice {
    font-weight: 700;
    white-space: nowrap;
    color: var(--clr-bark, #0d1b2a);
}

.orderSummary__choiceLabel {
    margin: 1rem 0 .625rem;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--clr-stone, #64748b);
}

/* --------------------------------------------------------------------------
   Pay options — the deposit / full choice.

   Whole-label targets: on a phone the tap area is the entire card, not a
   12px radio dot.
   -------------------------------------------------------------------------- */
.payOption {
    display: block;
    position: relative;
    padding: .875rem 1rem;
    margin-bottom: .625rem;
    background: #fff;
    border: 2px solid var(--clr-parchment, #e2e8f0);
    border-radius: var(--r-lg, .75rem);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

.payOption:hover {
    border-color: var(--clr-secondary, #5cb338);
}

.payOption--on {
    border-color: var(--clr-secondary, #5cb338);
    background: rgba(92, 179, 56, .06);
}

/* Visually hidden, not display:none — it must stay focusable and reachable
   by keyboard and by assistive technology. */
.payOption__radio {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus has to be visible on the card, since the control itself is hidden. */
.payOption__radio:focus-visible + .payOption__body {
    outline: 2px solid var(--clr-accent, #1582c7);
    outline-offset: 4px;
    border-radius: var(--r-sm, .25rem);
}

.payOption__body {
    display: block;
}

.payOption__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .75rem;
}

.payOption__name {
    font-weight: 700;
    color: var(--clr-bark, #0d1b2a);
}

.payOption__amount {
    font-weight: 700;
    white-space: nowrap;
    color: var(--clr-bark, #0d1b2a);
}

.payOption__note {
    display: block;
    margin-top: .3rem;
    font-size: .82rem;
    line-height: 1.45;
    color: var(--clr-stone, #64748b);
}

.payOption__badge {
    display: inline-block;
    margin-top: .5rem;
    padding: .1rem .5rem;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #fff;
    background: var(--clr-secondary, #5cb338);
    border-radius: var(--r-full, 50rem);
}

/* --------------------------------------------------------------------------
   Total and the pay button
   -------------------------------------------------------------------------- */
.orderSummary__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin: 1rem 0 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--clr-parchment, #e2e8f0);
}

.orderSummary__totalLabel {
    font-weight: 700;
    color: var(--clr-earth, #334155);
}

.orderSummary__totalValue {
    font-family: var(--font-serif, sans-serif);
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    color: var(--clr-bark, #0d1b2a);
}

.orderSummary__pay {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    padding: .95rem 1rem;
    font-size: 1.03rem;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: var(--clr-secondary, #5cb338);
    border: none;
    border-radius: var(--r-md, .5rem);
    cursor: pointer;
    transition: background-color .15s ease, transform .1s ease;
}

.orderSummary__pay:hover {
    background: var(--clr-moss, #4a9122);
}

.orderSummary__pay:active {
    transform: translateY(1px);
}

.orderSummary__pay[disabled] {
    opacity: .7;
    cursor: progress;
}

.orderSummary__reassure {
    display: flex;
    gap: .5rem;
    margin: .9rem 0 0;
    font-size: .8rem;
    line-height: 1.5;
    color: var(--clr-stone, #64748b);
}

.orderSummary__reassure i {
    margin-top: .15rem;
    color: var(--clr-secondary, #5cb338);
}

.orderSummary__trust {
    list-style: none;
    margin: 1rem 0 0;
    padding: 1rem 0 0;
    border-top: 1px solid var(--clr-parchment, #e2e8f0);
    font-size: .84rem;
    color: var(--clr-earth, #334155);
}

.orderSummary__trust li {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .2rem 0;
}

.orderSummary__trust i {
    color: var(--clr-secondary, #5cb338);
}

.orderSummary__alt {
    margin: 1rem 0 0;
    font-size: .82rem;
    color: var(--clr-stone, #64748b);
}

/* --------------------------------------------------------------------------
   Package picker
   -------------------------------------------------------------------------- */
.chooseGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: 1.25rem;
}

.chooseCard {
    display: flex;
    flex-direction: column;
    padding: 1.75rem 1.5rem;
    background: var(--clr-cream, #fff);
    border: 1px solid var(--clr-parchment, #e2e8f0);
    border-radius: var(--r-xl, 1rem);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, .06));
    text-decoration: none;
    color: inherit;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.chooseCard:hover,
.chooseCard:focus-visible {
    transform: translateY(-3px);
    border-color: var(--clr-secondary, #5cb338);
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, .12));
    color: inherit;
}

.chooseCard__name {
    margin: 0 0 .875rem;
    font-family: var(--font-serif, sans-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--clr-bark, #0d1b2a);
}

.chooseCard__deposit {
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: .4rem;
    flex-wrap: wrap;
}

.chooseCard__amount {
    font-family: var(--font-serif, sans-serif);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--clr-secondary, #5cb338);
}

.chooseCard__depositLabel {
    font-size: .9rem;
    font-weight: 600;
    color: var(--clr-stone, #64748b);
}

.chooseCard__total {
    margin: .5rem 0 0;
    font-size: .84rem;
    line-height: 1.5;
    color: var(--clr-stone, #64748b);
}

.chooseCard__cta {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: auto;
    padding-top: 1.25rem;
    font-weight: 700;
    color: var(--clr-accent, #1582c7);
}

.checkout__footnote {
    margin: 2rem 0 0;
    text-align: center;
    font-size: .9rem;
    color: var(--clr-stone, #64748b);
}

/* --------------------------------------------------------------------------
   Empty state — payments off, or nothing purchasable
   -------------------------------------------------------------------------- */
.checkoutEmpty {
    max-width: 34rem;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    text-align: center;
    background: var(--clr-cream, #fff);
    border: 1px solid var(--clr-parchment, #e2e8f0);
    border-radius: var(--r-xl, 1rem);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, .06));
}

.checkoutEmpty__icon {
    font-size: 2rem;
    color: var(--clr-secondary, #5cb338);
}

.checkoutEmpty__title {
    margin: 1rem 0 .625rem;
    font-family: var(--font-serif, sans-serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--clr-bark, #0d1b2a);
}

.checkoutEmpty__text {
    margin: 0 0 1.5rem;
    color: var(--clr-earth, #334155);
}

.checkoutEmpty__cta {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .8rem 1.5rem;
    font-weight: 700;
    color: #fff;
    background: var(--clr-secondary, #5cb338);
    border-radius: var(--r-md, .5rem);
    text-decoration: none;
}

.checkoutEmpty__cta:hover {
    background: var(--clr-moss, #4a9122);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .chooseCard,
    .orderSummary__pay,
    .payOption,
    .checkoutField__input {
        transition: none;
    }

    .chooseCard:hover,
    .chooseCard:focus-visible {
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   Terms agreement

   Sits immediately above the pay button: consent belongs next to the action it
   authorises, not buried at the top of a long form where it is scrolled past.
   The whole label is the hit target, so the tap area is the sentence rather
   than a 13px box.
   -------------------------------------------------------------------------- */
.termsAgree {
    margin: 0 0 1rem;
    padding: .75rem .875rem;
    background: var(--clr-linen, #f8fafc);
    border: 1px solid var(--clr-parchment, #e2e8f0);
    border-radius: var(--r-md, .5rem);
}

.termsAgree--error {
    border-color: var(--clr-terracotta, #ef4444);
    background: rgba(239, 68, 68, .05);
}

.termsAgree__label {
    display: flex;
    align-items: flex-start;
    gap: .625rem;
    margin: 0;
    font-size: .86rem;
    line-height: 1.5;
    color: var(--clr-earth, #334155);
    cursor: pointer;
}

/* Sized up from the browser default: this is the one control on the page that
   must not be fiddly to hit on a phone. */
.termsAgree__box {
    flex: 0 0 auto;
    width: 1.15rem;
    height: 1.15rem;
    margin-top: .1rem;
    accent-color: var(--clr-secondary, #5cb338);
    cursor: pointer;
}

.termsAgree__box:focus-visible {
    outline: 2px solid var(--clr-accent, #1582c7);
    outline-offset: 2px;
}

.termsAgree a {
    color: var(--clr-accent, #1582c7);
    font-weight: 600;
}
