.checkout-modal,
.checkout-modal * {
    box-sizing: border-box;
}

body.checkout-open {
    overflow: hidden;
}

.checkout-modal[hidden] {
    display: none;
}

.checkout-modal {
    position: fixed;
    z-index: 1300;
    inset: 0;
    padding: 28px;
    display: grid;
    place-items: center;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.checkout-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(9, 11, 15, .72);
    backdrop-filter: blur(10px);
    cursor: default;
    animation: checkout-fade .2s ease both;
}

.checkout-dialog {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    max-height: min(900px, calc(100vh - 56px));
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 28px;
    background: #f7f5f1;
    box-shadow: 0 38px 110px rgba(0, 0, 0, .38);
    overflow: hidden;
    animation: checkout-rise .28s ease both;
}

@keyframes checkout-fade {
    from { opacity: 0; }
}

@keyframes checkout-rise {
    from {
        opacity: 0;
        transform: translateY(22px) scale(.98);
    }
}

.checkout-dialog-head {
    position: relative;
    min-height: 160px;
    padding: 34px 76px 31px 38px;
    color: #fff;
    background:
        radial-gradient(circle at 85% 15%, rgba(239, 61, 50, .42), transparent 36%),
        linear-gradient(145deg, #1c2027, #101216);
    overflow: hidden;
}

.checkout-dialog-head::after {
    content: "S";
    position: absolute;
    right: 36px;
    bottom: -66px;
    color: rgba(239, 61, 50, .12);
    font-size: 210px;
    font-style: italic;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -.12em;
}

.checkout-step {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 12px;
    color: #ff9a93;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.checkout-step i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef3d32;
    box-shadow: 0 0 0 5px rgba(239, 61, 50, .13);
}

.checkout-dialog-head h2 {
    position: relative;
    z-index: 1;
    margin: 0;
    max-width: 600px;
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 820;
    line-height: 1.03;
    letter-spacing: -.05em;
}

.checkout-dialog-head > p:last-of-type {
    position: relative;
    z-index: 1;
    max-width: 620px;
    margin: 12px 0 0;
    color: rgba(255, 255, 255, .58);
    font-size: 12px;
}

.checkout-close {
    position: absolute;
    z-index: 3;
    top: 22px;
    right: 22px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #fff;
    background: rgba(255, 255, 255, .07);
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.checkout-close:hover,
.checkout-close:focus {
    background: rgba(255, 255, 255, .15);
    transform: rotate(4deg);
    outline: none;
}

.checkout-scroll {
    max-height: calc(100vh - 216px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.project-form {
    padding: 30px 38px 34px;
}

.form-section-label {
    margin: 0 0 18px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #7a7e86;
    font-size: 9px;
    font-weight: 820;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.form-section-label::after {
    content: "";
    height: 1px;
    flex: 1;
    background: rgba(22, 25, 31, .1);
}

.checkout-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
}

.checkout-field {
    min-width: 0;
}

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

.checkout-field label {
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #343941;
    font-size: 11px;
    font-weight: 760;
}

.checkout-field label span {
    color: #a0a3a8;
    font-size: 8px;
    font-weight: 650;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.checkout-field input,
.checkout-field select,
.checkout-field textarea {
    width: 100%;
    border: 1px solid rgba(22, 25, 31, .13);
    border-radius: 12px;
    color: #16191f;
    background: #fff;
    font-size: 13px;
    line-height: 1.45;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.checkout-field input,
.checkout-field select {
    height: 48px;
    padding: 0 14px;
}

.checkout-field select {
    padding-right: 38px;
}

.checkout-field textarea {
    min-height: 105px;
    padding: 12px 14px;
    resize: vertical;
}

.checkout-field input::placeholder,
.checkout-field textarea::placeholder {
    color: #b2b4b8;
}

.checkout-field input:focus,
.checkout-field select:focus,
.checkout-field textarea:focus {
    border-color: rgba(239, 61, 50, .7);
    box-shadow: 0 0 0 4px rgba(239, 61, 50, .1);
}

.checkout-field [aria-invalid="true"] {
    border-color: #d7291f;
    background: #fff7f6;
}

.field-error {
    min-height: 14px;
    margin: 4px 2px 0;
    color: #c6271d;
    font-size: 9px;
}

.checkout-honeypot {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
}

.checkout-security {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid rgba(22, 25, 31, .1);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
}

.checkout-security-copy {
    max-width: 380px;
}

.checkout-security-copy strong,
.checkout-security-copy span {
    display: block;
}

.checkout-security-copy strong {
    color: #2f343b;
    font-size: 11px;
}

.checkout-security-copy span {
    margin-top: 3px;
    color: #7c8189;
    font-size: 9px;
    line-height: 1.5;
}

.captcha-setup-note {
    max-width: 340px;
    padding: 10px 13px;
    border: 1px solid rgba(190, 119, 0, .2);
    border-radius: 10px;
    color: #7e5100;
    background: #fff3d8;
    font-size: 9px;
    line-height: 1.45;
}

.captcha-setup-note i {
    margin-right: 5px;
}

.checkout-submit-row {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.checkout-reassurance {
    max-width: 390px;
    margin: 0;
    color: #797e86;
    font-size: 9px;
    line-height: 1.55;
}

.checkout-reassurance i {
    margin-right: 5px;
    color: #16884b;
}

.checkout-submit {
    min-width: 210px;
    min-height: 50px;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #fff;
    background: #ef3d32;
    box-shadow: 0 13px 28px rgba(239, 61, 50, .24);
    font-size: 11px;
    font-weight: 790;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.checkout-submit:hover,
.checkout-submit:focus {
    background: #cc291f;
    box-shadow: 0 15px 32px rgba(239, 61, 50, .3);
    transform: translateY(-2px);
    outline: none;
}

.checkout-submit:disabled {
    opacity: .62;
    cursor: wait;
    transform: none;
}

.checkout-submit i {
    font-size: 11px;
}

.checkout-result {
    margin: 18px 0 0;
    padding: 11px 13px;
    border-radius: 10px;
    font-size: 10px;
    line-height: 1.5;
}

.checkout-result:empty {
    display: none;
}

.checkout-result.is-error {
    color: #9f2018;
    background: #ffe5e2;
}

.checkout-result.is-success {
    color: #126d42;
    background: #e1f6ea;
}

.checkout-success {
    padding: 60px 38px 70px;
    text-align: center;
}

.checkout-success[hidden] {
    display: none;
}

.checkout-success-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 21px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: #22a861;
    box-shadow: 0 18px 36px rgba(34, 168, 97, .23);
    font-size: 25px;
}

.checkout-success h3 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -.04em;
}

.checkout-success p {
    max-width: 470px;
    margin: 10px auto 0;
    color: #666c75;
    font-size: 13px;
}

.checkout-success button {
    margin-top: 24px;
}

@media (max-width: 700px) {
    .checkout-modal {
        padding: 0;
        place-items: end center;
    }

    .checkout-dialog {
        width: 100%;
        max-height: 94vh;
        border-radius: 25px 25px 0 0;
    }

    .checkout-dialog-head {
        min-height: 145px;
        padding: 28px 66px 25px 22px;
    }

    .checkout-dialog-head h2 {
        font-size: 31px;
    }

    .checkout-close {
        top: 17px;
        right: 17px;
    }

    .checkout-scroll {
        max-height: calc(94vh - 145px);
    }

    .project-form {
        padding: 25px 19px 30px;
    }

    .checkout-grid {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .checkout-field-wide {
        grid-column: auto;
    }

    .checkout-security {
        grid-template-columns: 1fr;
    }

    .cf-turnstile {
        max-width: 100%;
        overflow: hidden;
    }

    .checkout-submit-row {
        align-items: stretch;
        flex-direction: column;
    }

    .checkout-submit {
        width: 100%;
    }

    .checkout-reassurance {
        order: 2;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .checkout-backdrop,
    .checkout-dialog {
        animation: none;
    }
}
