/* Krafto hiring form: dark look (canvas #070708, orange #ff6b07). One question per screen. */
:root {
    --canvas: #070708;
    --surface: #111113;
    --surface-2: #17171a;
    --line: #232327;
    --line-strong: #303036;
    --ink: #f5f5f6;
    --ink-soft: #c9c9d1;
    --muted: #8b8b94;
    --faint: #5c5c66;
    --primary: #ff6b07;
    --primary-hi: #ff8a2a;
    --primary-lo: #f2410b;
    --danger: #fb7185;
    --success: #10b981;
    --ease: cubic-bezier(.22, 1, .36, 1);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
[hidden] { display: none !important; }

body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--canvas);
    color: var(--ink);
    font-family: 'Plus Jakarta Sans', 'IBM Plex Sans Arabic', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
html[dir="rtl"] body { font-family: 'IBM Plex Sans Arabic', 'Plus Jakarta Sans', system-ui, sans-serif; }

button { font: inherit; color: inherit; }
kbd { font-family: 'Plus Jakarta Sans', sans-serif; }

/* ------------------------------- Backdrop ------------------------------- */
.bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.bg .grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgb(255 255 255 / 0.06) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 75%);
}
.bg .glow {
    position: absolute;
    top: -220px;
    left: 50%;
    width: 900px;
    height: 520px;
    transform: translateX(-50%);
    background: radial-gradient(closest-side, rgb(255 107 7 / 0.22), transparent);
    filter: blur(10px);
}
.bg .glow-2 { top: auto; bottom: -320px; width: 700px; opacity: .35; }

/* -------------------------------- Header -------------------------------- */
.top {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 22px 22px 0;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand span { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 14px; letter-spacing: .22em; }
.lang {
    padding: 8px 15px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgb(17 17 19 / .7);
    backdrop-filter: blur(8px);
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .2s, color .2s;
}
.lang:hover { border-color: var(--primary); color: var(--ink); }

/* -------------------------------- Progress ------------------------------- */
.meter { position: relative; z-index: 2; width: 100%; max-width: 720px; margin: 26px auto 0; padding: 0 22px; }
.segments { display: grid; grid-auto-flow: column; gap: 6px; }
.segments span { height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.segments span::after { content: ''; display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--primary-hi), var(--primary-lo)); transition: width .5s var(--ease); }
html[dir="rtl"] .segments span::after { margin-inline-start: auto; }
.segments span.on::after { width: 100%; }
.count { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.count b { color: var(--ink); font-family: 'Plus Jakarta Sans', sans-serif; }

/* --------------------------------- Stage -------------------------------- */
.stage {
    position: relative;
    z-index: 1;
    flex: 1;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 22px;
    display: grid;
    align-items: center;
    align-content: center;
}
.step {
    grid-area: 1 / 1;
    padding: 24px 0 110px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(28px);
    transition: opacity .45s var(--ease), transform .55s var(--ease), visibility 0s linear .55s;
}
.step.active { opacity: 1; visibility: visible; transform: none; transition-delay: .08s, .08s, 0s; }
.step.leave-up { transform: translateY(-28px); }

/* Welcome */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    padding: 6px 12px;
    border: 1px solid rgb(255 107 7 / .3);
    border-radius: 999px;
    background: rgb(255 107 7 / .08);
    color: #ffa564;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
html[dir="rtl"] .eyebrow { letter-spacing: 0; font-size: 13px; }
.hero { margin: 0; font-size: clamp(36px, 8vw, 60px); font-weight: 800; line-height: 1.08; letter-spacing: -.03em; }
html[dir="rtl"] .hero { letter-spacing: 0; line-height: 1.25; }
.hero .name { background: linear-gradient(120deg, #ffb070, var(--primary) 45%, var(--primary-lo)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.2s ease-in-out 1s 2; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0) } 10%, 30% { transform: rotate(14deg) } 20%, 40% { transform: rotate(-8deg) } }
.lead { margin: 18px 0 0; max-width: 520px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 26px 0 34px; padding: 0; list-style: none; color: var(--ink-soft); font-size: 14px; font-weight: 500; }
.facts li { display: flex; align-items: center; gap: 9px; }
.facts .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 12px var(--primary); }
.hint { margin: 14px 0 0; color: var(--faint); font-size: 13px; }

/* Questions */
.q-title { margin: 0; font-size: clamp(24px, 5vw, 34px); font-weight: 700; line-height: 1.3; letter-spacing: -.02em; }
html[dir="rtl"] .q-title { letter-spacing: 0; line-height: 1.5; }
.q-sub { margin: 10px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.tag { display: inline-block; vertical-align: middle; margin-inline-start: 6px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0; }

.options { display: grid; gap: 10px; margin-top: 30px; max-width: 520px; }
.option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 18px;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: linear-gradient(180deg, rgb(255 255 255 / .02), transparent), var(--surface);
    font-size: 16px;
    font-weight: 600;
    text-align: start;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .15s var(--ease), box-shadow .2s;
}
.option:hover { border-color: #4a4a52; transform: translateY(-1px); }
.option:active { transform: scale(.99); }
.option:focus-visible { outline: none; box-shadow: 0 0 0 4px rgb(255 107 7 / .25); }
.option kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    transition: all .2s;
}
.option::after {
    content: '';
    margin-inline-start: auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--line-strong);
    transition: all .2s;
}
.option.selected { border-color: var(--primary); background: linear-gradient(180deg, rgb(255 107 7 / .14), rgb(255 107 7 / .06)); box-shadow: 0 10px 30px -12px rgb(255 107 7 / .5); }
.option.selected kbd { border-color: var(--primary); background: var(--primary); color: #fff; }
.option.selected::after {
    border-color: var(--primary);
    background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 13px no-repeat;
}
.option.pulse { animation: pulse .35s var(--ease); }
@keyframes pulse { 50% { transform: scale(1.015); } }

/* Text / money fields */
.field { position: relative; margin-top: 30px; max-width: 520px; }
.field input {
    width: 100%;
    padding: 18px 20px;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 17px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: var(--faint); }
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 5px rgb(255 107 7 / .14); }
.field-icon { position: absolute; top: 50%; left: 18px; width: 20px; height: 20px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.field:has(.field-icon) input { padding-left: 50px; }
.money input { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 34px; font-weight: 800; letter-spacing: -.01em; padding: 16px 84px 16px 22px; text-align: left; }
.money .unit { position: absolute; top: 50%; right: 20px; transform: translateY(-50%); padding: 6px 10px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 700; }
.field.invalid input { border-color: var(--danger); }

.note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 520px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.6;
}
.note svg { flex-shrink: 0; width: 15px; height: 15px; margin-top: 2px; fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; }

.err { margin: 10px 0 0; color: var(--danger); font-size: 13px; font-weight: 600; }
.err:empty { display: none; }

.row { display: flex; align-items: center; gap: 18px; margin-top: 26px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-hi), var(--primary-lo));
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 14px 34px -12px rgb(255 107 7 / .75), inset 0 1px 0 rgb(255 255 255 / .2);
    transition: transform .15s var(--ease), box-shadow .2s, opacity .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 18px 40px -12px rgb(255 107 7 / .85), inset 0 1px 0 rgb(255 255 255 / .2); }
.btn:active { transform: none; }
.btn[disabled] { opacity: .65; cursor: progress; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.btn:hover svg { transform: translateX(3px); }
html[dir="rtl"] .btn svg { transform: scaleX(-1); }
html[dir="rtl"] .btn:hover svg { transform: scaleX(-1) translateX(3px); }
.btn-lg { padding: 17px 30px; font-size: 16px; border-radius: 18px; }
.btn.loading svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.link { padding: 0; border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-strong); }
.link:hover { color: var(--ink); }

/* Bottom bar */
.nav {
    position: fixed;
    z-index: 3;
    inset: auto 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 720px;
    margin: 0 auto;
    padding: 18px 22px calc(18px + env(safe-area-inset-bottom));
}
.back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: rgb(17 17 19 / .8);
    backdrop-filter: blur(8px);
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .2s, color .2s, opacity .2s;
}
.back:hover { border-color: #4a4a52; color: var(--ink); }
.back[disabled] { opacity: 0; pointer-events: none; }
.back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
html[dir="rtl"] .back svg { transform: scaleX(-1); }
.keys { color: var(--faint); font-size: 12px; }

/* Done / missing */
.done, .missing { text-align: center; }
.done .lead, .missing .lead { margin-inline: auto; }
.check { width: 92px; height: 92px; margin: 0 auto 26px; }
.check svg { width: 100%; height: 100%; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.check circle { stroke: var(--success); stroke-width: 2.5; stroke-dasharray: 152; stroke-dashoffset: 152; }
.check path { stroke: var(--success); stroke-width: 3.5; stroke-dasharray: 40; stroke-dashoffset: 40; }
.done.active .check circle { animation: draw .7s var(--ease) .2s forwards; }
.done.active .check path { animation: draw .4s var(--ease) .75s forwards; }
.done.active .check { animation: glow 1.6s ease 1s; border-radius: 50%; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes glow { 50% { box-shadow: 0 0 60px rgb(16 185 129 / .35); } }
.badge-icon { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; margin-bottom: 22px; border-radius: 24px; background: rgb(251 113 133 / .12); color: var(--danger); font-size: 32px; font-weight: 800; }

@media (max-width: 560px) {
    .step { padding: 28px 0 110px; }
    .option { padding: 15px 16px; font-size: 15px; }
    .keys { display: none; }
    .row .btn { flex: 1; justify-content: center; }
    .intro .btn { width: 100%; justify-content: center; }
    .money input { font-size: 28px; }
}
@media (hover: none) { .hint { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Generated questions sit in the same grid cell as the other screens. */
.questions { display: contents; }
.field textarea {
    width: 100%;
    min-height: 140px;
    padding: 16px 20px;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 5px rgb(255 107 7 / .14); }
.field.invalid textarea { border-color: var(--danger); }
.field.number input { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 26px; font-weight: 700; }

/* "Krafto isn't the company…" under the start button */
.disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    max-width: 520px;
    margin: 34px 0 0;
    padding: 12px 14px;
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.6;
}
.disclaimer svg { flex-shrink: 0; width: 15px; height: 15px; margin-top: 2px; fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; }

.loading { display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
