/* =========================================================
   Personality Test: clean, modern UI
   ========================================================= */
:root {
    --bg: #f6f5fb;
    --surface: #ffffff;
    --ink: #17142b;
    --ink-2: #3d3a57;
    --muted: #6f6c88;
    --line: #e6e3f0;
    --primary: #6c4cf5;
    --primary-ink: #ffffff;
    --primary-soft: #efebff;
    --accent: #ff6b8b;
    --success: #12a26a;
    --success-soft: #e6f7ef;
    --danger: #e0394f;
    --danger-soft: #fdecef;
    --info-soft: #eef3ff;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 10px 30px rgba(32, 21, 87, .08);
    --shadow-lg: 0 30px 80px rgba(23, 20, 43, .25);
    --font: "Plus Jakarta Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; min-height: 100vh; display: flex; flex-direction: column;
    /* Subtle Trueself-inspired backdrop: soft purple, lavender and pink blooms. */
    background:
        radial-gradient(38% 34% at 10% 6%, rgba(108, 76, 245, .10), transparent 72%),
        radial-gradient(36% 32% at 92% 3%, rgba(199, 55, 171, .09), transparent 72%),
        radial-gradient(44% 42% at 85% 95%, rgba(255, 107, 139, .09), transparent 72%),
        radial-gradient(36% 36% at 15% 97%, rgba(168, 140, 247, .10), transparent 72%),
        var(--bg);
    background-attachment: fixed;
    color: var(--ink); font-family: var(--font);
    font-size: 16px; line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration: none; }
code { background: var(--primary-soft); padding: .1em .4em; border-radius: 6px; font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 32px; padding-bottom: 56px; }
.main--admin { max-width: 1240px; }
.inline { display: inline; margin: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.stack > * + * { margin-top: 12px; }
.section { margin-top: 40px; }
.section--muted { margin-top: 28px; }

.eyebrow { margin: 0 0 8px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.h2 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.2; margin: 0 0 12px; letter-spacing: -.02em; }
.h3 { font-size: 1.2rem; margin: 0 0 14px; letter-spacing: -.01em; }
.grad { background: linear-gradient(90deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Top bar ---------- */
.topbar { background: rgba(255,255,255,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
/* Homepage: no white header band — the logo sits on the page background. */
body.is-home .topbar { background: transparent; border-bottom: 0; backdrop-filter: none; position: static; }
/* Centered logo: stack the brand on top (centered) with any nav below it. */
.topbar__inner { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px 0; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand__logo { height: 80px; width: auto; max-width: 100%; display: block; }
/* Larger, clearly visible logo on phones. */
@media (max-width: 600px) { .brand__logo { height: 120px; } }
@media (max-width: 380px) { .brand__logo { height: 104px; } }
.topbar__nav { justify-content: center; }
.brand__mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--primary), var(--accent)); position: relative; flex: none; }
.brand__mark::after { content: ""; position: absolute; inset: 8px 9px 9px 9px; border-radius: 50% 50% 40% 40%; background: rgba(255,255,255,.95); }
.brand__mark--lg { width: 52px; height: 52px; border-radius: 16px; }
.brand__mark--lg::after { inset: 14px 15px 15px 15px; }
.topbar__nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: .95rem; }
.topbar__nav > a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.topbar__nav > a:hover, .topbar__nav > a.is-active { color: var(--primary); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.user-chip img, .user-chip__initial { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.user-chip__initial { display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: .8rem; }
.user-chip__name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .9rem; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
    font: inherit; font-weight: 700; font-size: .95rem; line-height: 1.2;
    text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s;
    background: var(--surface); color: var(--ink);
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 8px 20px rgba(108, 76, 245, .3); }
.btn--primary:hover { box-shadow: 0 12px 28px rgba(108, 76, 245, .38); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--lg { padding: 16px 30px; font-size: 1.05rem; }
.btn--sm { padding: 7px 14px; font-size: .85rem; }
.btn--xs { padding: 4px 10px; font-size: .8rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Cards, alerts, forms ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.card--narrow { max-width: 640px; margin-left: auto; margin-right: auto; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin: 0 0 16px; font-size: .95rem; background: var(--info-soft); color: var(--ink-2); }
.alert--success { background: var(--success-soft); color: #0b6b46; }
.alert--error { background: var(--danger-soft); color: #9b1c2e; }
.alert--warning { background: #fff6e5; color: #8a5a00; }
.pill { display: inline-block; margin: 0 0 14px; padding: 5px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .8rem; font-weight: 700; }

.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.field input, .field textarea, .field select, .input {
    font: inherit; font-weight: 400; font-size: .95rem; color: var(--ink);
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; width: 100%;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field--check { flex-direction: row; align-items: center; gap: 8px; }
.field--check input { width: auto; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form-grid .span-all { grid-column: 1 / -1; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 20px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 48px 0 16px; }
.hero--compact { padding-top: 24px; }
.hero__title { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.08; letter-spacing: -.035em; margin: 0 auto 16px; max-width: 760px; }
.hero__lead { font-size: 1.1rem; color: var(--muted); max-width: 560px; margin: 0 auto 28px; }
.hero__cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
/* Guest landing hero: logo + content grouped near the top. */
.hero--home { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 8px; padding-bottom: 40px; }
.hero--home .hero__title { max-width: 820px; }
@media (min-width: 900px) { .hero--home { padding-top: 24px; } }
.mini-card { display: inline-flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; font-weight: 600; box-shadow: var(--shadow); }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot--a { background: var(--primary); } .dot--b { background: var(--accent); } .dot--c { background: #ffb547; }

/* ---------- Mandatory sign-in modal ---------- */
body.is-locked { overflow: hidden; }
.locked-preview { filter: blur(6px); opacity: .55; pointer-events: none; user-select: none; }
.modal-backdrop {
    position: fixed; inset: 0; z-index: 50; display: flex; padding: 16px 16px 56px; overflow-y: auto;
    background: radial-gradient(circle at 20% 10%, rgba(108,76,245,.35), transparent 50%),
                radial-gradient(circle at 85% 90%, rgba(255,107,139,.3), transparent 50%),
                rgba(23, 20, 43, .45);
    overflow-y: auto;
}
.modal {
    width: 100%; max-width: 440px; margin: auto; background: var(--surface); border-radius: 24px;
    padding: 36px 28px 24px; box-shadow: var(--shadow-lg); text-align: center;
    animation: pop .35s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes pop { from { transform: translateY(16px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__logo { display: flex; justify-content: center; margin-bottom: 16px; }
.modal__title { font-size: 1.6rem; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 8px; }
.modal__lead { color: var(--muted); margin: 0 0 22px; }
.social-buttons { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.btn-social {
    display: flex; align-items: center; justify-content: center; gap: 12px; position: relative;
    padding: 14px 18px; border-radius: 14px; font-weight: 700; text-decoration: none;
    border: 1px solid var(--line); transition: transform .15s, box-shadow .15s;
}
.btn-social:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(23,20,43,.12); }
.btn-social__icon { width: 22px; height: 22px; display: inline-flex; }
.btn-social__icon svg { width: 100%; height: 100%; }
.btn-social--instagram { color: #fff; border: 0; background: linear-gradient(45deg, #f9ce34 0%, #ee2a7b 45%, #6228d7 100%); }
.btn-social--x { color: #fff; background: #000; border-color: #000; }
.btn-social--google { color: #1f1f1f; background: #fff; border-color: #dadce0; }
.fine { font-size: .8rem; color: var(--muted); margin: 10px 0 0; }

/* ---------- Results list ---------- */
.result-list { display: flex; flex-direction: column; gap: 10px; }
.result-item {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
    text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s;
}
.result-item:hover { border-color: var(--primary); transform: translateY(-1px); }
.result-item small { display: block; color: var(--muted); font-weight: 400; }

/* ---------- Test ---------- */
.test { max-width: 720px; margin: 0 auto; }
.test__progress { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.progress { flex: 1; height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress__bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 999px; transition: width .35s ease; }
.test__counter { font-weight: 700; color: var(--muted); font-size: .9rem; min-width: 56px; text-align: end; direction: ltr; unicode-bidi: isolate; }
.q-step { border: 0; padding: 0; margin: 0 0 40px; min-width: 0; }
.q-step__legend { padding: 0; margin-bottom: 20px; width: 100%; }
.q-step__num { display: block; font-size: .8rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.q-step__text { display: block; font-size: clamp(1.35rem, 3vw, 1.75rem); font-weight: 800; line-height: 1.25; letter-spacing: -.02em; }
.options { display: grid; gap: 12px; }
.option { position: relative; cursor: pointer; display: block; }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option__box {
    display: block; padding-block: 16px; padding-inline: 52px 20px; border: 2px solid var(--line); border-radius: 14px;
    background: var(--surface); font-weight: 600; transition: border-color .15s, background .15s, transform .15s; position: relative;
}
.option__box::before {
    content: ""; position: absolute; inset-inline-start: 18px; top: 50%; width: 20px; height: 20px; margin-top: -10px;
    border: 2px solid var(--line); border-radius: 50%; background: #fff; transition: all .15s;
}
.option:hover .option__box { border-color: #cfc6fb; transform: translateY(-1px); }
.option input:focus-visible + .option__box { outline: 3px solid var(--primary); outline-offset: 2px; }
.option input:checked + .option__box { border-color: var(--primary); background: var(--primary-soft); }
.option input:checked + .option__box::before { border-color: var(--primary); background: var(--primary); box-shadow: inset 0 0 0 4px #fff; }
.test__nav { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.test__error { color: var(--danger); font-weight: 600; text-align: end; margin-top: 10px; }
/* With JS: one question at a time */
.js .q-step { display: none; }
.js .q-step.is-current { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.js [data-prev] { margin-inline-end: auto; }
.no-js [data-prev], .no-js [data-next], .no-js .test__progress { display: none; }

/* ---------- Result ---------- */
.result__hero { text-align: center; padding: 24px 0 32px; }
.result__title { font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.05; letter-spacing: -.035em; margin: 0 0 10px;
    background: linear-gradient(90deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.result__tagline { font-size: 1.2rem; color: var(--ink-2); max-width: 620px; margin: 0 auto 8px; font-weight: 600; }
.result__grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .result__grid { grid-template-columns: 1.7fr 1fr; align-items: start; } }
.result__body p { margin: 0 0 14px; color: var(--ink-2); }
.result__actions { display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.bars__row { display: grid; gap: 6px; }
.bars__label { font-weight: 600; font-size: .9rem; display: flex; justify-content: space-between; gap: 8px; }
.bars__pct { color: var(--muted); font-variant-numeric: tabular-nums; }
.bars__track { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bars__fill { display: block; height: 100%; width: 0; background: #c9bffb; border-radius: 999px; transition: width .8s ease; }
.is-win .bars__fill { background: linear-gradient(90deg, var(--primary), var(--accent)); }
.is-win .bars__label { color: var(--primary); }

/* ---------- Prose (legal pages) ---------- */
.prose { max-width: 780px; margin: 0 auto; }
.prose h2 { font-size: 1.15rem; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--ink-2); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--surface); font-size: .875rem; color: var(--muted); }
.footer__inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; }
.footer nav { display: flex; gap: 16px; }
.footer a { color: var(--muted); }
body.is-locked .footer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: transparent; border: 0; }
body.is-locked .footer, body.is-locked .footer a { color: rgba(255,255,255,.85); }

/* ---------- Admin ---------- */
.admin-nav { background: var(--ink); }
.admin-nav__inner { display: flex; gap: 4px; overflow-x: auto; max-width: 1240px; }
.admin-nav a { color: rgba(255,255,255,.7); text-decoration: none; padding: 12px 14px; font-weight: 600; font-size: .9rem; white-space: nowrap; border-bottom: 3px solid transparent; }
.admin-nav a:hover { color: #fff; }
.admin-nav a.is-active { color: #fff; border-bottom-color: var(--accent); }
.admin-nav__logout { margin-inline-start: auto; display: flex; align-items: center; }
.admin-nav__logout button { background: none; border: 0; color: rgba(255,255,255,.7); font: inherit; font-weight: 600; font-size: .9rem; padding: 12px 14px; cursor: pointer; white-space: nowrap; }
.admin-nav__logout button:hover { color: #fff; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.stat__value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat__label { color: var(--muted); font-size: .85rem; font-weight: 600; }
.grid-2 { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist .ok::before { content: "✓"; color: var(--success); font-weight: 800; }
.checklist .bad::before { content: "✗"; color: var(--danger); font-weight: 800; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #faf9fe; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { white-space: nowrap; text-align: end; }
.table .actions form { display: inline; }
.avatar-sm { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--primary-soft); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--primary-soft); color: var(--primary); }
.badge--gmail { background: #fdecea; color: #b3261e; }
.badge--x { background: #111; color: #fff; }
.badge--instagram { background: #fde7f1; color: #b8136a; }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--muted { background: var(--line); color: var(--muted); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters .input { width: auto; min-width: 220px; }
.option-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 12px; background: #fcfbff; }
.points-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 10px; }
.points-grid label { font-size: .8rem; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.points-grid input { padding: 6px 8px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.pagination { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; background: var(--surface); font-size: .9rem; }
.pagination__current { background: var(--primary) !important; color: #fff; border-color: var(--primary) !important; }
.pagination__gap { border: 0 !important; background: transparent !important; }

@media (max-width: 600px) {
    .card { padding: 20px; }
    .user-chip__name { display: none; }
    .topbar__nav { gap: 10px; }
    .kv { grid-template-columns: 1fr; gap: 2px; }
    .kv dd { margin-bottom: 10px; }
}

/* ---------- Arabic / RTL ---------- */
[dir="rtl"] body, [dir="rtl"] .btn, [dir="rtl"] input, [dir="rtl"] textarea { font-family: "IBM Plex Sans Arabic", "Plus Jakarta Sans", system-ui, sans-serif; }
[dir="rtl"] * { letter-spacing: 0 !important; } /* letter-spacing breaks Arabic letter joining */
[dir="rtl"] .eyebrow, [dir="rtl"] .q-step__num { text-transform: none; }
[dir="rtl"] .hero__title, [dir="rtl"] .result__title { line-height: 1.3; }

/* ---------- Name step & misc ---------- */
.btn--block { width: 100%; }
.req { color: var(--danger); }
.field-error { color: var(--danger); font-weight: 600; font-size: .9rem; margin: -4px 0 0; }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.linklike { background: none; border: 0; padding: 8px; margin-top: 8px; font: inherit; font-size: .85rem; color: var(--muted); text-decoration: underline; cursor: pointer; }
.linklike:hover { color: var(--primary); }
.modal .stack { text-align: start; }
.secondary-trait { margin-top: 20px; padding: 16px 18px; border-radius: 14px; background: var(--primary-soft); }
.secondary-trait p { margin: 0; }
.secondary-trait .eyebrow { margin-bottom: 4px; }
/* ---------- Registration / sign-in form ---------- */
.modal--form { max-width: 480px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg); border-radius: 12px; margin: 0 0 18px; }
.tabs__tab { padding: 9px 10px; border-radius: 9px; text-decoration: none; font-weight: 700; color: var(--muted); font-size: .95rem; }
.tabs__tab.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px rgba(23,20,43,.08); }
.auth-form { display: grid; gap: 14px; text-align: start; margin-bottom: 8px; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 6px; font-weight: 600; font-size: .9rem; }
.platforms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.platform { position: relative; cursor: pointer; }
.platform input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.platform__box { display: block; text-align: center; padding: 10px 6px; border: 2px solid var(--line); border-radius: 12px; font-weight: 700; font-size: .9rem; background: #fff; transition: border-color .15s, background .15s; direction: ltr; }
.platform:hover .platform__box { border-color: #cfc6fb; }
.platform input:checked + .platform__box { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.platform input:focus-visible + .platform__box { outline: 3px solid var(--primary); outline-offset: 2px; }
.hint { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); line-height: 1.5; }
.hint--warn { color: #8a5a00; background: #fff6e5; padding: 8px 10px; border-radius: 8px; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-inline-end: 72px; }
.password-toggle { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; font: inherit; font-size: .8rem; font-weight: 700; color: var(--primary); cursor: pointer; padding: 6px 8px; }
.field select { font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
/* ---------- Two-step registration (English, LTR) ---------- */
.reg-form .reg-step { text-align: start; }
.js .reg-form .reg-step { display: none; }
.js .reg-form .reg-step.is-current { display: block; animation: fade .25s ease; }
.no-js .reg-form .reg-step + .reg-step { margin-top: 18px; }
.reg-form .field { margin-bottom: 14px; }
.reg-form .modal__title { margin-bottom: 18px; text-align: center; }
.platforms--lg { grid-template-columns: 1fr; gap: 12px; }
.platforms--lg .platform__box {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 16px 18px; font-size: 1.05rem; text-align: center; direction: inherit;
    transition: border-color .2s ease, background .2s ease, transform .15s ease, box-shadow .2s ease;
}
.platforms--lg .platform:hover .platform__box { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(108,76,245,.12); }
.platform__icon { flex: none; display: block; }
.platform__name { line-height: 1; }
.field-note { display: block; margin-top: 6px; font-size: .8rem; font-weight: 400; color: #9b98ad; line-height: 1.5; text-align: start; }
.reg-actions { display: flex; gap: 12px; align-items: center; margin-top: 20px; }
.reg-actions .btn--lg { flex: 1; }
.reg-actions [data-reg-back] { flex: 0 0 auto; }
.reg-actions--single { justify-content: flex-start; margin-top: 16px; }
.reg-actions--single .btn { flex: 0 0 auto; }

/* The wizard form holds the step cards; keep it at card width. */
.reg-form { width: 100%; max-width: 480px; margin: 0 auto; }

/* Step 0: welcome home — no card, just the Start button under the hero text. */
.reg-step--home { text-align: center; }
.js .reg-form .reg-step--home.is-current { display: flex; justify-content: center; }
.reg-step--home .btn { min-width: 220px; padding: 16px 34px; font-size: 1.1rem; }

/* Selected platform icon at the top of the registration form (visual only). */
.reg-selected-icon { display: none; }
.reg-selected-icon.is-shown { display: flex; justify-content: center; align-items: center; margin: 0 auto 14px; width: 64px; height: 64px; border-radius: 50%; background: var(--primary-soft); }
.reg-selected-icon .platform__icon--lg { width: 40px; height: 40px; display: block; }

/* Trueself logo in registration windows */
.reg-form .modal__logo { margin-bottom: 14px; }
.reg-logo { width: 150px; height: auto; max-width: 60%; display: block; }
@media (max-width: 480px) { .reg-logo { width: 124px; } }

/* Registration welcome message (both steps, above the card) */
body.is-register .modal-backdrop { flex-direction: column; justify-content: center; align-items: center; gap: 20px; }
body.is-register .modal { margin: 0; }
.reg-welcome {
    margin: 0; max-width: 620px; text-align: center;
    font-family: "IBM Plex Sans Arabic", var(--font);
    font-weight: 700; font-size: clamp(1.1rem, 2.7vw, 1.6rem); line-height: 1.75;
    color: #fff; text-shadow: 0 2px 18px rgba(23, 20, 43, .45);
}
@media (max-width: 480px) { .reg-welcome { font-size: 1.1rem; line-height: 1.7; } }

/* =========================================================
   Mobile responsiveness (iPhone / Android)
   ========================================================= */
html, body { overflow-x: hidden; max-width: 100%; }
* { -webkit-tap-highlight-color: rgba(108, 76, 245, .15); }
img, svg { max-width: 100%; }
/* Avoid sticky :hover lifts on touch devices */
@media (hover: none) {
    .btn:hover, .option:hover .option__box, .platforms--lg .platform:hover .platform__box { transform: none; }
}
@media (max-width: 600px) {
    /* 16px inputs prevent iOS Safari from auto-zooming on focus */
    .field input, .field select, .field textarea, .input { font-size: 16px; }
    .main { padding-top: 22px; padding-bottom: 40px; }
    .modal { padding: 26px 20px 20px; border-radius: 20px; }
    .modal__title { font-size: 1.4rem; }
    .btn--lg { padding: 15px 22px; font-size: 1rem; }
    .platforms--lg .platform__box { padding: 15px 16px; font-size: 1rem; }
    .hero__lead { font-size: 1rem; }
    .test__progress { gap: 10px; margin-bottom: 20px; }
    .q-step { margin-bottom: 28px; }
    .option__box { padding-block: 15px; padding-inline: 48px 16px; }
    .test__nav { justify-content: stretch; }
    .test__nav .btn { flex: 1; }
}
@media (max-width: 380px) {
    .modal { padding: 22px 15px 16px; }
    .reg-actions { gap: 8px; }
    .reg-actions .btn--lg { padding: 13px 14px; }
    .platform__box { gap: 8px; }
    .reg-logo { width: 112px; }
}