/* ============================================================
   Квіз «Ваша кар'єрна подорож»
   Палітра: --ice #EAF2FA · --navy #1E3A5C · --blue #2F6BA6
            --orange #EE7A33 · --ink #10161F · --line #A9C7E4
   ============================================================ */

:root {
    --ice: #eaf2fa;
    --ice-2: #dce9f6;
    --navy: #1e3a5c;
    --blue: #2f6ba6;
    --blue-soft: #4a90c4;
    --ink: #10161f;
    --muted: #6b7f93;
    --line: #a9c7e4;
    --underline: #b9ccdf;
    --orange-1: #f79b54;
    --orange-2: #ee7a33;
    --track: #cbd8e6;
    --fill: #3d5a7a;
    --error: #d64545;
    --ok: #4e9e5f;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
    background: var(--ice);
    color: var(--ink);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ---------- небо: м'які хмароподібні плями ---------- */
.sky {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.sky__blob {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .8;
}
.sky__blob--1 {
    width: 46vw; height: 30vw;
    left: -10vw; top: 8vh;
    background: #f6fafd;
    animation: drift 26s ease-in-out infinite alternate;
}
.sky__blob--2 {
    width: 38vw; height: 26vw;
    right: -8vw; top: 30vh;
    background: var(--ice-2);
    animation: drift 32s ease-in-out infinite alternate-reverse;
}
.sky__blob--3 {
    width: 40vw; height: 24vw;
    left: 25vw; bottom: -12vh;
    background: #f0f7fc;
    animation: drift 38s ease-in-out infinite alternate;
}
@keyframes drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(4vw, -3vh, 0) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
    .sky__blob { animation: none; }
}

/* ---------- шапка ---------- */
.topbar {
    position: relative;
    z-index: 1;
    padding: 22px 28px;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: .04em;
    color: var(--navy);
}
.topbar__quiz { color: var(--blue-soft); }

/* ---------- сцена ---------- */
.stage {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 4px 20px 60px;
}

.step-label {
    text-align: center;
    color: var(--blue);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .12em;
    margin: 10px 0 22px;
}
.step-label b { font-weight: 800; }

/* ---------- картка ---------- */
.card {
    position: relative;
    background: #fff;
    border: 2px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(30, 58, 92, .10);
    padding: 46px 56px 40px;
    min-height: 540px;
    display: flex;
    flex-direction: column;
}

.pane {
    display: none;
    flex-direction: column;
    flex: 1;
    animation: pane-in .45s ease both;
}
.pane.is-active { display: flex; }
@keyframes pane-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .pane { animation: none; }
}

.pane__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
}

.pane__title {
    text-align: center;
    font-size: 34px;
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--ink);
}
.pane__sub {
    text-align: center;
    font-size: 17px;
    color: #2a3746;
    margin-top: -18px;
}

/* ---------- CTA ---------- */
.pane__cta { text-align: center; margin-top: 34px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .08em;
    color: #fff;
    padding: 17px 46px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--orange-1), var(--orange-2));
    box-shadow: 0 14px 28px rgba(238, 122, 51, .35);
    transition: transform .18s ease, box-shadow .18s ease;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(238, 122, 51, .42);
}
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .65; cursor: wait; transform: none; }
.btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.btn__arrow { display: inline-block; transition: transform .18s ease; }

.pane__note {
    margin-top: 14px;
    font-size: 13px;
    font-weight: 600;
    color: #22303f;
}

/* ---------- крок 1: слайдер ---------- */
.salary {
    display: flex;
    align-items: flex-start;
    gap: 26px;
    padding: 0 8px;
}
.salary__icon { flex: 0 0 auto; margin-top: 4px; }

/* Висота блока не фіксується: підписи шкали — у потоці документа,
   тож блок росте разом із ними і не наїжджає на кнопку. */
.range {
    position: relative;
    flex: 1;
    padding-top: 44px;
}

.range__tip {
    position: absolute;
    top: 0;
    left: 70%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(30, 58, 92, .12);
    font-size: 14px;
    font-weight: 600;
    color: #2a3746;
    padding: 7px 14px;
    transition: left .08s linear;
}
.range__tip b { font-weight: 800; color: var(--ink); }
.range__uah {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px; height: 20px;
    margin-left: 4px;
    border: 1.5px solid var(--line);
    border-radius: 50%;
    font-size: 11px;
    color: var(--muted);
    vertical-align: -4px;
}

.range__track {
    position: absolute;
    left: 0; right: 0;
    top: 53px;
    height: 8px;
    border-radius: 6px;
    background: var(--track);
}
.range__fill {
    position: absolute;
    top: 0; bottom: 0;
    border-radius: 6px;
    background: var(--fill);
}

.range input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    left: 0;
    top: 44px;
    width: 100%;
    height: 26px;
    margin: 0;
    background: none;
    pointer-events: none;
}
.range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #c4d4e6;
    box-shadow: 0 3px 8px rgba(20, 40, 70, .28);
    cursor: grab;
    transition: transform .12s ease;
}
.range input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.1); }
.range input[type="range"]:active::-webkit-slider-thumb { cursor: grabbing; }
.range input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #c4d4e6;
    box-shadow: 0 3px 8px rgba(20, 40, 70, .28);
    cursor: grab;
}
.range input[type="range"]::-moz-range-track { background: none; }
.range input[type="range"]:focus-visible { outline: none; }
.range input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--blue); outline-offset: 2px; }
.range input[type="range"]:focus-visible::-moz-range-thumb { outline: 3px solid var(--blue); outline-offset: 2px; }

.range__labels {
    display: flex;
    justify-content: space-between;
    margin-top: 30px; /* 44px падінгу + 30px = ті самі 74px від верху блока */
    font-size: 13px;
    font-weight: 600;
    color: #33475c;
}
.range__labels span { white-space: nowrap; }

/* ---------- поля ---------- */
.fields {
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 34px;
}
.fields__row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 34px;
}

.field { position: relative; }
.field--icon {
    display: flex;
    align-items: flex-end;
    gap: 22px;
}
.field--icon .field__icon { flex: 0 0 auto; padding-bottom: 4px; }
.field--icon .field__box { flex: 1; }

.field__label,
.group-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .04em;
    color: #16212e;
    margin-bottom: 8px;
}

.field input,
.exp__row input,
.phone input {
    width: 100%;
    border: 0;
    border-bottom: 2px solid var(--underline);
    background: transparent;
    font-family: inherit;
    font-size: 17px;
    color: var(--ink);
    padding: 8px 2px;
    border-radius: 0;
    transition: border-color .15s ease;
}
.field input,
.exp__row input,
.phone input { text-overflow: ellipsis; }
.field input::placeholder,
.exp__row input::placeholder,
.phone input::placeholder { color: #93a5b7; font-weight: 500; text-overflow: ellipsis; }
.field input:focus,
.exp__row input:focus,
.phone input:focus { outline: none; border-bottom-color: var(--blue); }

.field__wrap { position: relative; }
.field__search {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* число без стрілок-спінерів там, де вони зайві */
.field--age input::-webkit-outer-spin-button,
.field--age input::-webkit-inner-spin-button { opacity: 1; }

.field__err {
    display: block;
    min-height: 16px;
    margin-top: 5px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--error);
}
.is-invalid input { border-bottom-color: var(--error) !important; }

/* ---------- крок 3 ---------- */
.exp {
    display: flex;
    gap: 22px;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}
.exp__icon { flex: 0 0 auto; margin-top: 2px; }
.exp__body { flex: 1; }
.exp__row {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 24px;
    align-items: start;
}

.radios { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.radio {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
}
.radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.radio__dot {
    flex: 0 0 auto;
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2px solid #8aa5c0;
    background: #fff;
    position: relative;
    transition: border-color .15s ease;
}
.radio input:checked + .radio__dot { border-color: var(--blue); }
.radio input:checked + .radio__dot::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--blue);
}
.radio input:focus-visible + .radio__dot { outline: 3px solid var(--blue); outline-offset: 2px; }

.contact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}

.messengers { display: flex; gap: 16px; padding-top: 4px; }
.msg {
    width: 52px; height: 52px;
    border-radius: 50%;
    border: 3px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(20, 40, 70, .22);
    transition: transform .15s ease, border-color .15s ease, opacity .15s ease;
    opacity: .55;
}
.msg:hover { transform: translateY(-2px) scale(1.05); opacity: .85; }
.msg.is-active { opacity: 1; border-color: var(--navy); transform: scale(1.06); }
.msg:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.msg--tg { background: linear-gradient(180deg, #37aee2, #1e96c8); }
.msg--vb { background: #7360f2; }
.msg--wa { background: #25d366; }

.phone {
    display: flex;
    align-items: center;
    gap: 10px;
}
.flag {
    flex: 0 0 auto;
    width: 30px; height: 20px;
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(20, 40, 70, .3);
}
.flag i { display: block; flex: 1; }
.flag i:first-child { background: #005bbb; }
.flag i:last-child { background: #ffd500; }
.phone__code { font-size: 19px; font-weight: 700; color: var(--ink); }

.field--username {
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}

/* ---------- фінальний екран ---------- */
.pane--done .pane__body { align-items: center; gap: 22px; }
.done__text {
    text-align: center;
    font-size: 17px;
    line-height: 1.6;
    color: #2a3746;
}
.done__circle {
    stroke-dasharray: 264;
    stroke-dashoffset: 264;
    animation: draw .7s ease forwards;
}
.done__tick {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: draw .45s ease .55s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
    .done__circle, .done__tick { animation: none; stroke-dashoffset: 0; }
}

/* ---------- повідомлення про cookie ---------- */
.cookiebar {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translate(-50%, 24px);
    z-index: 50;
    width: calc(100% - 32px);
    max-width: 620px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 14px 40px rgba(30, 58, 92, .18);
    padding: 14px 18px;
    opacity: 0;
    transition: opacity .35s ease, transform .35s ease;
}
.cookiebar.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}
.cookiebar__icon { font-size: 24px; flex: 0 0 auto; }
.cookiebar__text {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
    color: #2a3746;
}
.cookiebar__btn {
    flex: 0 0 auto;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    color: #fff;
    padding: 10px 22px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--orange-1), var(--orange-2));
    box-shadow: 0 8px 18px rgba(238, 122, 51, .3);
    transition: transform .15s ease;
}
.cookiebar__btn:hover { transform: translateY(-1px); }
.cookiebar__btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    .cookiebar { transition: opacity .2s ease; transform: translate(-50%, 0); }
}
@media (max-width: 560px) {
    .cookiebar { flex-wrap: wrap; padding: 14px 16px; bottom: 12px; width: calc(100% - 24px); }
    .cookiebar__icon { display: none; }
    .cookiebar__btn { width: 100%; padding: 12px; }
}

/* ---------- струс картки при помилці ---------- */
.card.shake { animation: shake .4s ease; }
@keyframes shake {
    20% { transform: translateX(-8px); }
    40% { transform: translateX(7px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(3px); }
}

/* ---------- адаптив ---------- */
@media (max-width: 760px) {
    .topbar { font-size: 17px; padding: 18px 20px; }
    .card { padding: 32px 22px 30px; min-height: 0; border-radius: 18px; }
    .pane__title { font-size: 24px; }
    .pane__title br,
    .done__text br { display: none; } /* природний перенос замість жорсткого */
    .pane__body { gap: 24px; }
    .salary { flex-direction: column; align-items: center; gap: 10px; padding: 0; }
    /* у колонці flex:1 стискає висоту до нуля — вимикаємо */
    .range { flex: none; width: 100%; }
    .range__tip { font-size: 12.5px; padding: 6px 11px; }
    .range__labels { font-size: 10.5px; }
    .field input::placeholder,
    .exp__row input::placeholder { font-size: 15px; }
    .fields__row { grid-template-columns: 1fr; gap: 26px; }
    .field--icon .field__icon { display: none; }
    .exp { flex-direction: column; gap: 12px; }
    .exp__icon { display: none; }
    .exp__row { grid-template-columns: 1fr; gap: 14px; }
    .contact { grid-template-columns: 1fr; }
    .btn { width: 100%; justify-content: center; padding: 16px 20px; }
}

@media (max-width: 374px) {
    .range__labels { font-size: 9.5px; }
}
