/* Noor Web v2 — account pages: sign in, create account, forgot password, sent,
   reset password. Every value is the design's (design/noor-web-v2/Noor Auth.dc.html
   and the board's "6 Handoff"), in plain CSS with logical properties and the 14
   tokens. Desktop values first; below 640px the design's mobile values. */

/* The account pages scroll (the chat never does): undo base.css's fixed body.
   The design hides the scrollbar of its scroll container. */
html.na-doc, html.na-doc body { height: auto; min-height: 100%; overflow: visible; }
html.na-doc { scrollbar-width: none; }
html.na-doc::-webkit-scrollbar { display: none; }

/* Handoff "Autofill and behaviour", verbatim. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-1);
  caret-color: var(--text-1);
  -webkit-box-shadow: 0 0 0 1000px var(--surface-1) inset;
  box-shadow: 0 0 0 1000px var(--surface-1) inset;
  transition: background-color 9999s ease-out 0s;
}
input::-ms-reveal, input::-ms-clear { display: none; }
input::placeholder { color: var(--text-2); opacity: 1; }
:focus-visible { outline: 1px solid var(--focus-ring); outline-offset: 2px; }

/* The component's own focus rules (Noor Auth.dc.html <helmet>). */
.na a:focus-visible, .na button:focus-visible { outline: 1px solid var(--focus-ring); outline-offset: 2px; }
.na .na-eye:focus-visible { outline-offset: -4px; }
.na input:focus-visible { outline: none; }
.na a, .na a:hover { color: var(--text-1); }
.na [hidden] { display: none !important; }

.na {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text-1);
  font-family: 'Noto Sans', 'Noto Sans Arabic', sans-serif; font-size: 15px; line-height: 24px;
}

/* Top bar: the chat's (mark and نور at the start, the language toggle at the end). */
.na-top {
  flex: none; height: 64px; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between;
  padding-inline-start: 20px; padding-inline-end: 16px;
}
.na-home { display: flex; align-items: center; gap: 10px; height: 44px; color: var(--text-1); text-decoration: none; }
.na-home img { width: 22px; height: 22px; display: block; flex: none; }
.na-word { font-family: 'Alexandria', 'Noto Sans Arabic', sans-serif; font-weight: 600; font-size: 20px; line-height: 28px; }
.na-toggle {
  height: 36px; min-width: 36px; padding: 1px 12px; box-sizing: border-box; border: 0; border-radius: 22px; background: transparent;
  display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none;
  font-family: 'Noto Sans', sans-serif; font-size: 13px; line-height: 18px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--text-2); cursor: pointer; transition: background-color 140ms ease-out, color 140ms ease-out;
}
.na[dir=ltr] .na-toggle { font-family: 'Noto Sans Arabic', sans-serif; letter-spacing: 0; }
.na .na-toggle:hover { background: var(--surface-1); color: var(--text-1); }
.na .na-toggle { color: var(--text-2); }

/* Main: one 400px column, centred; the page scrolls on short screens. */
.na-main { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px 24px 24px; }
.na-col { width: 100%; max-width: 400px; display: flex; flex-direction: column; }

/* The mark: dim (text-3 through the logo mask) under the gold image. */
.na-mark { position: relative; align-self: center; flex: none; width: 40px; height: 40px; view-transition-name: noor-mark; }
.na-mark-dim {
  position: absolute; inset: 0; background: var(--text-3); opacity: 0;
  -webkit-mask: url(/noor/img/noor.png) center / contain no-repeat; mask: url(/noor/img/noor.png) center / contain no-repeat;
}
.na-mark-gold { position: absolute; inset: 0; width: 40px; height: 40px; display: block; }

/* Handoff "Motion": 1 · light on, first load only (never after a failed attempt). */
.noor-mark-dim  { animation: noor-off 600ms ease-out both; }
.noor-mark-gold { animation: noor-on 600ms ease-out both; }
@keyframes noor-on  { from { opacity: 0; } to { opacity: 1; } }
@keyframes noor-off { from { opacity: 1; } to { opacity: 0; } }
.nw-vt .noor-mark-dim, .nw-vt .noor-mark-gold { animation: none; }

/* Heading: kicker (sign in only), display, sub. */
.na-head { margin-top: 16px; display: flex; flex-direction: column; align-items: center; text-align: center; view-transition-name: auth-heading; }
.na-kicker { margin-bottom: 2px; font-size: 18px; line-height: 26px; color: var(--text-2); }
.na-display { margin: 0; font-family: 'Alexandria', 'Noto Sans Arabic', sans-serif; font-weight: 300; font-size: 40px; line-height: 52px; text-wrap: balance; }
.na[dir=ltr] .na-display { font-family: 'Noto Sans', sans-serif; }
.na-sub { margin: 6px 0 0; font-size: 15px; line-height: 24px; color: var(--text-2); text-wrap: pretty; }
.na-sub bdi { color: var(--text-1); }

/* Social block and the divider (only when the product enables a provider). */
.na-social { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; view-transition-name: auth-social; }
.na .na-soc {
  height: 52px; box-sizing: border-box; border: 0; border-radius: 26px; background: transparent; box-shadow: inset 0 0 0 1px var(--hairline);
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 1px 20px; text-decoration: none; text-align: center;
  font: inherit; font-size: 15px; line-height: 22px; font-weight: 500; color: var(--text-1); cursor: pointer;
  transition: background-color 140ms ease-out;
}
.na .na-soc:hover { background: var(--surface-1); color: var(--text-1); }
.na .na-soc:active { background: var(--surface-2); }
.na-soc img, .na-soc svg { width: 18px; height: 18px; display: block; flex: none; }
.na-soc .na-apple { margin-top: -2px; }
.na-or { margin-block: 16px; display: flex; align-items: center; gap: 16px; view-transition-name: auth-or; }
.na-rule { flex: 1; height: 1px; background: var(--divider); }
.na-or-text { font-size: 13px; line-height: 18px; color: var(--text-2); }

/* Form. Without the social block it sits 32 under the heading. */
.na-form { margin: 0; display: flex; flex-direction: column; }
.na-form.is-alone { margin: 32px 0 0; }
.na-fields { display: flex; flex-direction: column; gap: 16px; }
.na-group { display: flex; flex-direction: column; }
.na-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.na-label { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-2); }
.na .na-link { padding: 0; margin: 0; font-size: 13px; line-height: 18px; color: var(--text-2); text-decoration: none; text-underline-offset: 3px; }
.na .na-link:hover { color: var(--text-2); text-decoration: underline; }

/* Field: a 52 capsule; the 1px edge is a span above the input, so autofill
   can never cover it. */
.na-cap { position: relative; height: 52px; border-radius: 26px; overflow: hidden; background: var(--surface-1); display: flex; align-items: center; }
.na-input {
  flex: 1; min-width: 0; height: 100%; box-sizing: border-box; margin: 0; border: 0; border-radius: 26px; outline: none; background: transparent;
  padding-block: 1px; padding-inline-start: 20px; padding-inline-end: 20px;
  font: inherit; font-size: 16px; line-height: 24px; color: var(--text-1); caret-color: var(--text-1); text-align: start;
}
.na-input.is-pw { padding-inline-end: 4px; }
/* Email and password are always LTR, aligned to the page's start; the name
   follows the page (text-align: start). */
.na[dir=rtl] .na-input.is-ltr { text-align: right; }
.na[dir=ltr] .na-input.is-ltr { text-align: left; }
.na-ring {
  position: absolute; inset: 0; border-radius: 26px; pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--hairline); transition: box-shadow 140ms ease-out;
}
/* The ring follows the input's own focus (the design's `focus` state), so the
   eye, inside the capsule, does not light it. */
.na-cap:has(.na-input:focus) .na-ring { box-shadow: inset 0 0 0 1px var(--focus-ring); }
.na-form[data-busy] .na-cap .na-ring { box-shadow: inset 0 0 0 1px var(--hairline); }
.na-cap[data-invalid] .na-ring, .na-cap[data-invalid]:has(.na-input:focus) .na-ring { box-shadow: inset 0 0 0 1px rgba(255, 69, 58, .60); }

/* Eye: a 44 circle 4 from the end, concentric with the capsule. */
.na-eye {
  flex: none; width: 44px; height: 44px; margin-inline-end: 4px; padding: 0; border: 0; border-radius: 22px; background: transparent;
  display: flex; align-items: center; justify-content: center; color: var(--text-2); cursor: pointer;
  transition: background-color 140ms ease-out, color 140ms ease-out;
}
.na-eye:hover { background: var(--surface-2); color: var(--text-1); }
.na-eye svg { display: block; }
.na-eye svg[hidden] { display: none; }

/* Under the field: the rule, Caps Lock, the error. */
.na-desc { display: flex; flex-direction: column; }
.na-hint { margin-top: 8px; font-size: 13px; line-height: 18px; color: var(--text-2); }
.na-caps { margin-top: 8px; display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; color: var(--text-2); }
.na-caps svg { display: block; flex: none; }
.na-err { margin-top: 8px; font-size: 13px; line-height: 18px; color: var(--red); }
.na-caps[hidden], .na-err[hidden] { display: none; }

/* Remember me: an 18px box, the native input kept in the DOM above it. */
.na-remember { margin-top: 16px; align-self: flex-start; position: relative; display: flex; align-items: center; gap: 10px; min-height: 24px; cursor: pointer; view-transition-name: auth-remember; }
.na-remember input { position: absolute; inset-inline-start: 0; top: 50%; width: 18px; height: 18px; margin: -9px 0 0; opacity: 0; cursor: pointer; }
.na-box {
  width: 18px; height: 18px; flex: none; box-sizing: border-box; border-radius: 5px; background: var(--surface-1);
  box-shadow: inset 0 0 0 1px var(--hairline); display: flex; align-items: center; justify-content: center; color: var(--text-1);
  transition: background-color 140ms ease-out;
}
.na-box svg { display: block; visibility: hidden; }
.na-remember input:checked + .na-box { background: var(--surface-3); }
.na-remember input:checked + .na-box svg { visibility: visible; }
.na-remember input:focus-visible + .na-box { outline: 1px solid var(--focus-ring); outline-offset: 2px; }
.na-remember-text { font-size: 15px; line-height: 22px; color: var(--text-2); }

/* CAPTCHA (only when enabled): centred, 24 above the primary button, no wrapper. */
.na-captcha { margin-top: 24px; align-self: center; }

/* Primary: waits in surface-3 (aria-disabled, never disabled) and lights gold
   when the form is valid; gold while Noor is acting. */
.na-primary {
  margin-top: 24px; width: 100%; height: 52px; flex: none; box-sizing: border-box; border: 0; border-radius: 26px;
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 1px 20px;
  font: inherit; font-size: 16px; line-height: 24px; font-weight: 600;
  background: var(--surface-3); color: var(--text-3); cursor: default;
  transition: background-color 160ms ease-out, color 160ms ease-out; view-transition-name: auth-primary;
}
.na-primary[data-ready], .na-primary[aria-busy="true"] { background: var(--gold); color: var(--on-gold); }
.na-primary[data-ready]:not([aria-busy="true"]) { cursor: pointer; }
.na-primary[data-ready]:not([aria-busy="true"]):active { background: var(--gold-pressed); }
.na-spin { display: block; flex: none; animation: noorSpin .8s linear infinite; }
.na-spin[hidden] { display: none; }
.na-spin circle { fill: none; stroke: var(--on-gold); stroke-width: 2.25; stroke-linecap: round; stroke-dasharray: 40 100; }
@keyframes noorSpin { to { transform: rotate(360deg); } }

/* The switch line: text-2 with a text-1 600 link, never gold. */
.na-switch { margin: 20px 0 0; text-align: center; font-size: 15px; line-height: 24px; color: var(--text-2); text-wrap: pretty; view-transition-name: auth-switch; }
.na-switch.is-sent { margin-top: 32px; }
.na .na-switch a { color: var(--text-1); font-weight: 600; text-decoration: none; text-underline-offset: 4px; }
.na .na-switch a:hover { color: var(--text-1); text-decoration: underline; }

/* Footer: the legal line, then the copyright. */
.na-foot {
  flex: none; padding: 8px 24px 24px; display: flex; flex-wrap: wrap; justify-content: center; column-gap: 24px; row-gap: 4px;
  font-size: 12px; line-height: 16px; color: var(--text-3); text-align: center;
}
.na .na-foot a { color: var(--text-2); text-decoration: none; text-underline-offset: 3px; }
.na .na-foot a:hover { color: var(--text-2); text-decoration: underline; }

/* The design's mobile values (its `mobile` = narrower than 640). */
@media (max-width: 639.98px) {
  .na-top { padding-inline-start: 16px; padding-inline-end: 8px; }
  .na-toggle { height: 44px; min-width: 44px; }
  .na-main { padding: 16px 24px 32px; }
  .na-display { font-size: 34px; line-height: 44px; }
  .na .na-forgot { padding: 13px 0; margin: -13px 0; }
  .na-remember { min-height: 44px; }
}
/* 44 targets on touch (handoff: toggle 36 / 44 touch, remember row 24 / 44 touch). */
@media (pointer: coarse) {
  .na-toggle { height: 44px; min-width: 44px; }
  .na-remember { min-height: 44px; }
}

/* Handoff reduced motion, verbatim (the View Transition rules are in base.css). */
@media (prefers-reduced-motion: reduce) {
  .noor-mark-dim, .noor-mark-gold { animation: none; }
  .noor-mark-dim { opacity: 0; }
}
