/* Registration and sign-in page. Builds on home.css tokens. */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; }
.auth { flex: 1; padding: 40px 0 64px; }
.auth-grid { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 32px; align-items: start; max-width: 1080px; }

/* side panel */
.side-panel { background: var(--ink); color: var(--bg); border-radius: 22px; padding: 34px 30px; position: sticky; top: 92px; display: grid; gap: 26px; }
.side-panel h1 { font-size: clamp(28px, 3vw, 36px); }
.side-lead { opacity: .8; margin-top: -10px; }
.pick { margin: 0; display: grid; gap: 0; border-top: 1px solid color-mix(in srgb, var(--bg) 20%, transparent); }
.pick div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid color-mix(in srgb, var(--bg) 20%, transparent); }
.pick dt { opacity: .72; font-size: 15px; }
.pick dd { margin: 0; font-weight: 650; text-align: end; overflow-wrap: anywhere; min-width: 0; }
.calm { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 15.5px; }
.calm li { position: relative; padding-inline-start: 24px; }
.calm li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .55em; width: 11px; height: 6px; border-inline-start: 2px solid var(--red); border-bottom: 2px solid var(--red); transform: rotate(-45deg); }
.side-help { font-size: 14.5px; opacity: .85; }
.side-help a { font-family: var(--mono); font-size: 14px; }

/* card */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 30px; box-shadow: var(--shadow); min-width: 0; }
.signed { background: var(--info-soft); color: var(--ink); border-radius: 12px; padding: 14px 16px; margin-bottom: 20px; display: grid; gap: 10px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: var(--bg); border-radius: 13px; margin-bottom: 26px; }
.tabs button { border: 0; background: transparent; padding: 11px 12px; border-radius: 10px; font-weight: 650; font-size: 16px; color: var(--ink-2); cursor: pointer; min-height: 44px; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 27, 45, .12), 0 0 0 1px var(--line); }

/* step indicator */
.steps { list-style: none; margin: 0 0 24px; padding: 0; display: flex; gap: 8px; }
.steps li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--muted); padding-top: 10px; border-top: 3px solid var(--line); }
.steps .n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-2); font-size: 13px; font-weight: 650; font-family: var(--mono); }
.steps li.past { border-top-color: var(--ink-2); color: var(--ink-2); }
.steps li.past .n { background: var(--ink-2); border-color: var(--ink-2); color: var(--surface); }
.steps li[aria-current="step"] { border-top-color: var(--red); color: var(--ink); font-weight: 650; }
.steps li[aria-current="step"] .n { border-color: var(--red); color: var(--red-ink); }

/* steps */
.step { border: 0; margin: 0; padding: 0; min-width: 0; }
.step legend { font-family: var(--display); font-weight: 700; font-size: 23px; letter-spacing: -.015em; line-height: 1.2; margin-bottom: 18px; padding: 0; }
html[lang="ar"] .step legend { font-family: var(--arabic); letter-spacing: 0; }
.types { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 2px 12px; align-items: center; padding: 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .15s, background-color .15s; }
.type:hover { border-color: var(--line-2); }
.type input { position: absolute; opacity: 0; inset-inline-end: 12px; top: 12px; width: 18px; height: 18px; margin: 0; }
.type svg { grid-row: span 3; width: 38px; height: 38px; padding: 8px; border-radius: 10px; background: var(--bg); stroke: var(--ink); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; align-self: start; }
.type b { font-size: 15.5px; line-height: 1.3; padding-inline-end: 18px; }
.type small { color: var(--muted); font-size: 13.5px; line-height: 1.35; }
.type em { font-style: normal; font-size: 12.5px; font-weight: 650; color: var(--info); margin-top: 4px; }
.type em.live { color: var(--ok); }
.type:has(input:checked) { border-color: var(--ink); background: var(--surface-2); box-shadow: 0 0 0 1px var(--ink); }
.type:has(input:checked) svg { background: var(--ink); stroke: var(--bg); }
.type::after { content: ""; position: absolute; inset-inline-end: 12px; top: 12px; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); }
.type:has(input:checked)::after { border: 5.5px solid var(--red); }
.type:has(input:focus-visible) { outline: 3px solid var(--red); outline-offset: 2px; }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.lbl { font-weight: 650; font-size: 15px; }
.field input { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 11px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; }
.field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 30%, transparent); }
.field input[aria-invalid="true"] { border-color: var(--red); }
.field input.mono { font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.field input[dir="ltr"] { text-align: left; }
.pw { position: relative; display: block; }
.pw input { padding-inline-end: 52px; }
.eye { position: absolute; inset-inline-end: 4px; top: 4px; width: 42px; height: 40px; border: 0; background: transparent; border-radius: 9px; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.eye svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.eye[aria-pressed="true"] { color: var(--ink); background: var(--bg); }
.meter { display: block; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s, background-color .2s; }
.meter i[data-level="2"] { background: var(--wait); }
.meter i[data-level="3"], .meter i[data-level="4"] { background: var(--ok); }
.hint { font-size: 14px; color: var(--muted); }
.more { margin: 2px 0 16px; }
.more summary { cursor: pointer; font-weight: 600; color: var(--ink-2); padding: 6px 0; }
.more[open] summary { margin-bottom: 10px; }
.check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 15px; color: var(--ink-2); margin: 4px 0 8px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--red); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.explain { color: var(--ink-2); margin-bottom: 18px; }

.msg { min-height: 0; margin: 4px 0 0; font-size: 15px; color: var(--red-ink); }
.msg:empty { display: none; }
.msg.ok { color: var(--ok); }
.msg.info { color: var(--ink-2); }
.msg-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.nav-btns { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.nav-btns .btn:only-child { margin-inline-start: auto; }
.btn.wide { width: 100%; margin-top: 8px; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid #fff; border-right-color: transparent; animation: spin .8s linear infinite; }
.btn-line.busy::after { border-color: var(--ink); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.linkish { border: 0; background: none; padding: 6px 0; color: var(--ink); font-weight: 650; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; margin-top: 14px; }
.switch-note { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line-2); color: var(--muted); }
.switch-note .linkish { margin: 0; }
.reset { margin-top: 18px; padding: 18px; border-radius: 14px; background: var(--bg); }
.reset > p:first-child { margin-bottom: 14px; color: var(--ink-2); }
.newpw h2 { font-size: 24px; margin-bottom: 18px; }

.progress { list-style: none; margin: 16px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--bg); display: grid; gap: 8px; font-size: 15px; }
.progress li { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.progress li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; }
.progress li.run { color: var(--ink); }
.progress li.run::before { border-color: var(--ink); border-right-color: transparent; animation: spin .8s linear infinite; }
.progress li.ok { color: var(--ink); }
.progress li.ok::before { background: var(--ok); border-color: var(--ok); }
.progress li.fail { color: var(--red-ink); }
.progress li.fail::before { background: var(--red); border-color: var(--red); }

.done { text-align: center; padding: 10px 0; display: grid; justify-items: center; gap: 14px; }
.done:focus { outline: none; }
.done .tick { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); display: grid; place-items: center; }
.done .tick svg { width: 34px; height: 34px; stroke: var(--ok); fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.done h2 { font-size: clamp(26px, 3vw, 32px); }
.done > p { color: var(--ink-2); font-size: 18px; max-width: 30em; }
.done .next { text-align: start; max-width: 30em; margin: 6px 0 8px; color: var(--ink-2); }
.offline-note { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--wait-soft); color: var(--wait); font-size: 15px; font-weight: 600; }

.mini-foot { padding: 24px 0 32px; font-size: 14px; color: var(--muted); }
.mini-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; border-top: 1px solid var(--line); padding-top: 20px; }
.mini-foot nav { display: flex; flex-wrap: wrap; gap: 0 10px; }
.mini-foot a { text-decoration: none; display: inline-block; padding: 10px 4px; }
.mini-foot a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .auth { padding-top: 20px; }
  .auth-grid { grid-template-columns: 1fr; gap: 16px; }
  .side-panel { position: static; order: 2; padding: 26px 22px; }
}
@media (max-width: 520px) {
  .card { padding: 20px 16px; border-radius: 18px; }
  .types { grid-template-columns: 1fr; }
  .steps li { font-size: 13.5px; }
  .step legend { font-size: 21px; }
  .nav-btns .btn { flex: 1; }
}
