.checkout {
    #header {
        position: relative;

        #title-container {
            p {
                max-width: none;
            }

            padding-bottom: 300px;
        }

        img.bottom.left {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 296px;
            height: 193px;
        }

        img.bottom.right {
            position: absolute;
            bottom: 0;
            right: 0;
            width: 296px;
            height: 193px;
        }
    }

    .checkout-content {
        margin-top: -260px;
        position: relative;

        width: 100%;
        max-width: 1000px;
        box-sizing: border-box;

        .box.white {
            padding: 32px 20px;
            border-radius: 40px;
            border: 1px solid #EEE;
            background: #FFF;
            box-shadow: 0 40px 80px 0 rgba(0, 0, 0, 0.05);
            gap: 20px;

            @media screen and (min-width: 876px) {
                padding: 40px;
            }

            &>div:first-child {

                p,
                h2 {
                    text-align: start;
                }
            }
        }

        #plan-chooser,
        #payment-chooser {
            input[type="radio"] {
                display: none;
            }

            label {
                width: 100%;
                height: 100%;
                box-sizing: border-box;
                border-radius: 24px;
                border: 2px solid #EEE;
                background: url("../images/radio-56JOmU-.svg") no-repeat 16px 16px;

                @media screen and (min-width: 876px) {
                    background: url("../images/radio-56JOmU-.svg") no-repeat 24px 32px;
                }
            }

            input[type="radio"]:checked+label {
                background: none;
                background-image: url("../images/radio-checked-GJi0cwX.svg"), linear-gradient(white, white), linear-gradient(90deg, rgb(172, 112, 239) 0%, rgb(242, 127, 190) 50%, rgb(255, 182, 129) 100%);
                background-position: 16px 16px, 100% 100%, 100% 100%;
                background-origin: padding-box, border-box, border-box;
                background-repeat: no-repeat, no-repeat, no-repeat;
                background-clip: border-box, padding-box, border-box;
                border-width: 2px;
                border-style: solid;
                border-color: transparent;
                border-image: initial;

                @media screen and (min-width: 876px) {
                    background-position: 24px 32px, 100% 100%, 100% 100%;
                }
            }

            .payment {
                display: flex;
                flex-direction: row;
                justify-content: start;
                align-items: start;
                gap: 8px;
                padding: 1rem 1rem 1rem 48px;

                @media screen and (min-width: 876px) {
                    padding: 24px 24px 24px 64px;
                }

                img {
                    display: block;
                    max-width: 32px;
                    margin-top: 8px;
                }

                .title {
                    display: block;
                    margin-top: 8px;
                    color: #0A011A;
                    font-size: 16px;
                    font-weight: 500;
                    line-height: normal;
                    margin-bottom: 8px;

                    @media screen and (min-width: 876px) {
                        font-size: 20px;
                        line-height: normal;
                    }
                }

                p {
                    font-size: 16px;
                    line-height: normal;
                }
            }

            #pay-now {
                width: 100%;
                max-width: 350px;
                font-size: 1rem;
                font-weight: 800;
            }

            .plan {
                display: flex;
                flex-direction: column;
                justify-content: start;
                align-items: start;
                padding: 1rem 1rem 1rem 48px;
                gap: 1rem;

                @media screen and (min-width: 876px) {
                    flex-direction: row;
                    justify-content: space-between;
                    align-items: center;
                    padding: 24px 24px 24px 64px;
                }

                .badge {
                    display: inline-block;
                }

                .price {
                    display: inline-block;
                    color: #0A011A;
                    font-family: "Neue Kaine";
                    font-size: 20px;
                    font-weight: 700;
                    line-height: normal;

                    /* Each line (price, trial-hint) flush right on its own —
                       not ragged like a left-aligned paragraph block. */
                    @media screen and (min-width: 876px) {
                        text-align: right;
                    }

                    .slash {
                        font-weight: 400;
                    }

                    .period {
                        font-size: 16px;
                        font-weight: 500;
                    }
                }

                &.pink {
                    .badge {
                        color: #FF4AD1;
                        background: rgba(255, 74, 209, 0.10);
                    }
                }

                &.blue {
                    .badge {
                        color: #4AAEFF;
                        background: rgba(74, 174, 255, 0.10);
                    }
                }

                &.green {
                    .badge {
                        color: #099C61;
                        background: rgba(9, 156, 97, 0.10);
                    }
                }

                &.orange {
                    .badge {
                        color: #FF954A;
                        background: rgba(255, 149, 74, 0.10);
                    }
                }
            }
        }

        #account-chooser {
            label {
                color: #0A011A;
                font-size: 14px;
                font-weight: 400;
                line-height: normal;
                margin-bottom: 8px;
                display: block;
            }

            input[type="email"],
            input[type="text"],
            input[type="password"] {
                padding: 16px;
                border-radius: 16px;
                border: 1px solid #EEE;
                background: #FFF;
                color: #0A011A;
                font-size: 16px;
                font-style: normal;
                font-weight: 500;
                line-height: normal;
                position: relative;
                
                &:user-valid {
                    border-color: #00C853;

                    & + span:after {
                        content: "";
                        position: absolute;
                        top: 50%;
                        right: 16px;
                        transform: translateY(-50%);
                        width: 24px;
                        height: 24px;
                        background: url("../images/green-check-223M_jX.svg") no-repeat center center;
                    }
                }

                &:user-invalid {
                    border-color: #ff4a4a;

                    & + span:after {
                        content: "";
                        position: absolute;
                        top: 50%;
                        right: 16px;
                        transform: translateY(-50%);
                        width: 24px;
                        height: 24px;
                        background: url("../images/red-cross-yx-MRHF.svg") no-repeat center center;
                    }
                }
            }

            input[type="email"] {
                background: url("../images/email-header-5oSO4RU.svg") no-repeat 16px center;
                padding: 16px 48px;
                box-sizing: border-box;
                width: 100%;
            }

            input[type="text"] {
                background: url("../images/username-header-ChqZh8S.svg") no-repeat 16px center;
                padding: 16px 48px;
                box-sizing: border-box;
                width: 100%;
            }

            #password {
                background: url("../images/password-header-wR6dqEB.svg") no-repeat 16px center;
                padding: 16px 48px;
                box-sizing: border-box;
                width: 100%;
            }

            .unmask {
                position: absolute;
                right: 16px;
                top: 50%;
                transform: translateY(-50%);
            }

        }
    }
}
/* Payment-method notes, trial hints, and the crypto payment flow */
.checkout .checkout-content {

    .trial-hint {
        display: block;
        font-size: 13px;
        font-weight: 500;
        color: #B26B00;
        margin-top: 4px;
    }

    .method-note {
        font-size: 14px;
        border-radius: 12px;
        padding: 10px 12px;

        &.warn {
            background: rgba(255, 149, 74, 0.12);
            color: #8A5200;
        }

        &.good {
            background: rgba(9, 156, 97, 0.10);
            color: #099C61;
        }
    }

    #payment-chooser .disabled {
        opacity: 0.45;

        label {
            cursor: not-allowed;
        }
    }

    .error-message {
        /* Direct flex child of .box (align-items: flex-start) — without this it
           shrinks to its text width instead of spanning the card. */
        align-self: stretch;
        width: 100%;
        box-sizing: border-box;
        color: #C62828;
        background: rgba(198, 40, 40, 0.08);
        border-radius: 12px;
        padding: 12px 16px;
        text-align: center;
    }

    #crypto-flow {

        .crypto-breadcrumb {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 8px;
            font-size: 14px;
            color: #888;
            margin: 8px 0 16px;

            span {
                padding: 6px 14px;
                border-radius: 999px;
                background: #F4F4F6;
                border: 1px solid #EEE;
            }

            span.active {
                color: #FFF;
                font-weight: 700;
                background: #AC70EF;
                border-color: #AC70EF;
            }
        }

        /* The step wrappers are direct flex children of .box (align-items:
           flex-start), so they need an explicit width to span the card. */
        [data-crypto-target="stepCurrency"],
        [data-crypto-target="stepNetwork"] {
            width: 100%;
        }

        /* Network buttons are text-only (no coin icon), so give the grid some
           breathing room between the explanation above and the nav below, and
           keep them left-aligned at a uniform size instead of spread out. */
        [data-crypto-target="stepNetwork"] .crypto-grid {
            padding: 20px 0;
            justify-content: flex-start;

            .crypto-option {
                min-width: 160px;
            }
        }

        .crypto-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            width: 100%;
            justify-content: space-between;
        }

        .crypto-option {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            min-width: 110px;
            padding: 16px 12px;
            border-radius: 16px;
            border: 2px solid #EEE;
            background: #FFF;
            cursor: pointer;
            font-size: 14px;
            /* The checkout hero cascades a light text colour; without this the
               network buttons (plain textContent) render white-on-white. */
            color: #0A011A;

            &:hover {
                border-color: #AC70EF;
            }

            /* Coin logos are SVGs with wildly different intrinsic sizes; the JS
               only sets height, so clamp both dimensions to keep them square. */
            img {
                width: auto;
                height: 40px;
                max-width: 40px;
                max-height: 40px;
                object-fit: contain;
            }

            .sym {
                font-weight: 700;
                color: #0A011A;
            }

            .name {
                color: #888;
                font-size: 12px;
            }
        }

        .crypto-pay {
            display: flex;
            flex-direction: column;
            gap: 20px;

            @media screen and (min-width: 876px) {
                flex-direction: row;
                align-items: flex-start;
            }

            .crypto-qr svg {
                border: 1px solid #EEE;
                border-radius: 16px;
                max-width: 220px;
                height: auto;
            }

            .crypto-details {
                flex: 1;
                overflow-wrap: anywhere;

                .crypto-amount {
                    font-size: 20px;
                }

                .crypto-address {
                    display: flex;
                    align-items: center;
                    gap: 12px;
                    flex-wrap: wrap;
                    margin: 20px 0;

                    code {
                        background: #F6F6F6;
                        border-radius: 8px;
                        padding: 10px 12px;
                        font-size: 14px;
                    }

                    .btn-copy {
                        padding: 8px 16px;
                        border: 1px solid #AC70EF;
                        border-radius: 8px;
                        font-size: 14px;
                        color: #AC70EF;
                        background: #FFF;
                    }
                }

                .crypto-countdown {
                    font-size: 16px;
                    margin-top: 20px;
                }
            }
        }

        .crypto-warnings {
            border-top: 1px solid #EEE;
            margin-top: 20px;
            padding-top: 16px;

            p {
                font-size: 13px;
                color: #666;
                margin-bottom: 6px;
                text-align: start;
            }
        }

        .crypto-nav {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
            width: 100%;

            .btn {
                font-size: 14px;
                border: 1px solid #DDD;
                border-radius: 12px;
                padding: 10px 20px;
                color: #0A011A;
                background: #FFF;
                width: 100%;
                box-sizing: border-box;
                text-align: center;
            }

            @media screen and (min-width: 876px) {
                .btn {
                    width: 50%;
                }
            }
        }
    }
}

/* Payment method cards: logo(s) stacked above the "Pay with" title */
.checkout .checkout-content #payment-chooser .payment {
    img {
        margin-top: 0;
        margin-bottom: 8px;
        max-height: 32px;
        width: auto;
    }

    .method-logos {
        display: flex;
        gap: 8px;
        align-items: center;
        margin-bottom: 8px;

        img {
            margin-bottom: 0;
        }
    }

    .title {
        margin-top: 0;
    }
}

/* Inline field feedback under the account inputs — the message half of the
   red-cross indicator (customValidity text only shows on submit). */
#account-chooser {
    .field-error {
        color: #ff4a4a;
        font-size: 12px;
        margin: 6px 0 0;
    }

    .signin-hint a {
        color: inherit;
        font-weight: 600;
        text-decoration: underline;
    }
}
