.callback-flow[hidden] {
    display: none !important;
}

.callback-flow__step[hidden],
.callback-flow__success[hidden],
.callback-flow__error[hidden],
.callback-flow__back[hidden],
.callback-flow__next[hidden],
.callback-flow__submit[hidden] {
    display: none !important;
}

.callback-flow {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: grid;
    place-items: center;
    padding: 20px;
}

.callback-flow__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 28, 0.56);
    backdrop-filter: blur(6px);
}

.callback-flow__dialog {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    max-height: min(760px, calc(100vh - 40px));
    overflow: hidden;
    border: 1px solid rgba(22, 27, 64, 0.12);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 24px 80px rgba(8, 12, 28, 0.32);
}

.callback-flow__form {
    display: grid;
    gap: 18px;
    padding: 28px;
}

.callback-flow__trap {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.callback-flow__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(22, 27, 64, 0.12);
    border-radius: 50%;
    background: #ffffff;
    color: var(--dark-blue);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.callback-flow__close span {
    display: block;
    line-height: 0.85;
    transform: translateY(-1px);
}

.callback-flow__eyebrow,
.callback-flow__step-count {
    margin: 0;
    color: #5f6688;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.callback-flow__header {
    padding-right: 36px;
}

.callback-flow__header h2 {
    margin: 6px 0 10px;
    color: var(--dark-blue);
    font-family: var(--font-heading);
    font-size: clamp(1.45rem, 3vw, 2rem);
    line-height: 1.16;
}

.callback-flow__header p:last-child {
    margin: 0;
    color: #4d536f;
    font-size: 1rem;
    line-height: 1.55;
}

.callback-flow__progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(22, 27, 64, 0.08);
}

.callback-flow__progress span {
    display: block;
    width: 25%;
    height: 100%;
    border-radius: inherit;
    background: var(--yellow);
    transition: width 0.22s ease;
}

.callback-flow__body {
    min-height: 250px;
}

.callback-flow__step {
    display: none;
    margin: 0;
    padding: 0;
    border: 0;
}

.callback-flow__step.is-active {
    display: block;
}

.callback-flow__step legend {
    margin-bottom: 14px;
    color: var(--dark-blue);
    font-size: 1.18rem;
    font-weight: 900;
}

.callback-flow__step-hint {
    margin: -6px 0 14px;
    color: #5f6688;
    font-size: 0.95rem;
    line-height: 1.45;
}

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

.callback-flow__options label {
    cursor: pointer;
}

.callback-flow__options input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.callback-flow__options span {
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 13px 14px;
    border: 1px solid rgba(22, 27, 64, 0.12);
    border-radius: 8px;
    color: var(--dark-blue);
    background: #ffffff;
    font-weight: 800;
    line-height: 1.25;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.callback-flow__options input:focus-visible + span,
.callback-flow__fields input:focus {
    outline: 3px solid rgba(237, 231, 66, 0.5);
    outline-offset: 2px;
}

.callback-flow__options input:checked + span {
    border-color: rgba(237, 231, 66, 0.95);
    background: rgba(237, 231, 66, 0.14);
    box-shadow: 0 0 0 2px rgba(237, 231, 66, 0.28);
}

.callback-flow__fields {
    display: grid;
    gap: 12px;
}

.callback-flow__fields label {
    display: grid;
    gap: 7px;
    color: var(--dark-blue);
    font-weight: 800;
}

.callback-flow__fields small {
    color: #7a809b;
    font-weight: 700;
}

.callback-flow__fields input {
    width: 100%;
    min-height: 52px;
    padding: 0 14px;
    border: 1px solid rgba(22, 27, 64, 0.14);
    border-radius: 8px;
    color: var(--dark-blue);
    font-size: 1rem;
}

.callback-flow__error {
    padding: 11px 12px;
    border-radius: 8px;
    color: #842029;
    background: #f8d7da;
    font-weight: 700;
}

.callback-flow__actions {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    gap: 10px;
}

.callback-flow__actions button {
    min-height: 58px;
    padding: 0 24px;
    border: 0;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 1.02rem;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.callback-flow__back {
    padding: 0 18px;
    border: 1px solid rgba(22, 27, 64, 0.14);
    background: #ffffff;
    color: var(--dark-blue);
}

.callback-flow__next,
.callback-flow__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--yellow) 0%, #ffd700 100%);
    color: var(--dark-blue);
    box-shadow: 0 14px 28px rgba(237, 231, 66, 0.28);
}

.callback-flow__next:hover,
.callback-flow__submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(237, 231, 66, 0.34);
}

.callback-flow__actions button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
    box-shadow: none;
}

.callback-flow__next,
.callback-flow__submit {
    grid-column: 1 / -1;
}

.callback-flow__back:not([hidden]) + .callback-flow__next,
.callback-flow__back:not([hidden]) + .callback-flow__next + .callback-flow__submit,
.callback-flow__back:not([hidden]) ~ .callback-flow__submit {
    grid-column: 2;
}

.callback-flow__success {
    display: grid;
    place-items: center;
    min-height: 250px;
    text-align: center;
}

.callback-flow__success i {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: var(--yellow);
    color: var(--dark-blue);
}

.callback-flow__success h3 {
    margin: 0 0 8px;
    color: var(--dark-blue);
    font-family: var(--font-heading);
}

.callback-flow__success p {
    max-width: 360px;
    margin: 0;
    color: #4d536f;
}

body.callback-flow-open {
    overflow: hidden;
}

.hero-callback-actions {
    display: grid;
    gap: 12px;
    width: min(100%, 704px);
}

.hero-callback-primary,
.hero-callback-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    border-radius: 8px;
    font-weight: 900;
    text-decoration: none;
}

.hero-callback-primary {
    border: 1px solid var(--yellow);
    background: var(--yellow);
    color: var(--dark-blue) !important;
}

.hero-callback-secondary {
    border: 1px solid rgba(22, 27, 64, 0.14);
    background: #ffffff;
    color: var(--dark-blue) !important;
}

.calculator-lead-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    margin-top: 16px;
    padding: 0 18px;
    border: 1px solid var(--yellow);
    border-radius: 8px;
    background: var(--yellow);
    color: var(--dark-blue) !important;
    font-weight: 900;
    text-decoration: none;
}

@media (max-width: 768px) {
    .callback-flow {
        align-items: end;
        padding: 0;
    }

    .callback-flow__dialog {
        width: 100%;
        max-height: min(92vh, 760px);
        border-radius: 18px 18px 0 0;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
    }

    .callback-flow__form {
        max-height: min(92vh, 760px);
        overflow-y: auto;
        padding: 22px 16px calc(22px + env(safe-area-inset-bottom));
    }

    .callback-flow__options {
        grid-template-columns: 1fr;
    }

    .callback-flow__body,
    .callback-flow__success {
        min-height: 300px;
    }

    .callback-flow__actions {
        position: sticky;
        bottom: 0;
        z-index: 2;
        margin: 0 -16px calc(-22px - env(safe-area-inset-bottom));
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: linear-gradient(180deg, rgba(255,255,255,0.86), #ffffff 24%);
    }

    .hero-callback-primary,
    .hero-callback-secondary {
        width: 100%;
        min-height: 54px;
    }
}
