/* ==========================================================================
   nv-auth.css — the sign-in surface
   ==========================================================================

   One stylesheet for two presentations of the same markup:

     .nv-auth                 a modal, over the landing / card / menu pages
     .nv-auth.is-inline       a panel, sitting in the /auth/login page

   WHY THIS IS NOT TAILWIND
   ------------------------
   The auth screen is the one page that has to work when everything else has
   not loaded. Tailwind's output here is purged against template sources, so a
   class that only ever appears inside a string in JavaScript is silently
   dropped from the build — which is survivable on a marketing section and not
   survivable on the only way into the product. Plain CSS, shipped whole.

   COLOURS
   -------
   Every colour is derived from the DaisyUI theme tokens the rest of the site
   sets on <html data-theme>, so light and dark follow the user's toggle with
   no second palette to keep in step. The literal after each var() is the
   fallback for a page that somehow loads this file without the theme CSS.

   NO CDN. No font, no icon set, no script is fetched from anywhere but this
   origin — the site has to work from inside Iran without a VPN.
   ========================================================================== */

.nv-auth {
  /* ── tokens ─────────────────────────────────────────────────────────── */
  --nv-a-bg: var(--color-base-100, #ffffff);
  --nv-a-bg-soft: var(--color-base-200, #fafafa);
  --nv-a-bg-sink: var(--color-base-300, #f1f1f3);
  --nv-a-ink: var(--color-base-content, #1c1c22);
  --nv-a-primary: var(--color-primary, #4f39f6);
  --nv-a-primary-ink: var(--color-primary-content, #ffffff);
  --nv-a-secondary: var(--color-secondary, #ec4899);
  --nv-a-ok: var(--color-success, #16a34a);
  --nv-a-bad: var(--color-error, #e11d48);

  /* Derived tints. color-mix keeps these correct in both themes from one
     declaration; the plain value above each is what an older browser gets. */
  --nv-a-muted: #6b7280;
  --nv-a-muted: color-mix(in oklab, var(--nv-a-ink) 58%, transparent);
  --nv-a-line: #e4e4e7;
  --nv-a-line: color-mix(in oklab, var(--nv-a-ink) 14%, transparent);
  --nv-a-line-strong: #c7c7cd;
  --nv-a-line-strong: color-mix(in oklab, var(--nv-a-ink) 28%, transparent);
  --nv-a-tint: rgba(79, 57, 246, .08);
  --nv-a-tint: color-mix(in oklab, var(--nv-a-primary) 10%, transparent);
  --nv-a-ring: rgba(79, 57, 246, .22);
  --nv-a-ring: color-mix(in oklab, var(--nv-a-primary) 24%, transparent);

  /* Vazirmatn renders Persian digit shapes for 0-9 under lang="fa", which
     every page here is. Turning off 'locl' and 'ss02' does not undo it — those
     shapes are the font's defaults in this subset — and neither the input's
     lang attribute nor font-feature-settings reaches ::placeholder in
     Chromium. Naming a font without the substitution is what actually works,
     and it is scoped to the few places where a digit is data rather than
     prose: a phone number, a one-time code, a countdown. Persian numerals are
     still used everywhere they are read rather than typed. */
  --nv-a-latin: system-ui, 'Segoe UI', Roboto, Tahoma, Arial, sans-serif;

  --nv-a-radius: 16px;
  --nv-a-shadow: 0 24px 60px -18px rgba(15, 15, 30, .30);

  font-family: inherit;
  color: var(--nv-a-ink);
}

/* ── the overlay presentation ─────────────────────────────────────────── */

.nv-auth:not(.is-inline) {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;          /* bottom sheet on a phone */
  justify-content: center;
  padding: 0;
}
.nv-auth:not(.is-inline)[hidden] { display: none; }

@media (min-width: 640px) {
  .nv-auth:not(.is-inline) { align-items: center; padding: 1.5rem; }
}

.nv-auth__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 9, 20, .55);
  backdrop-filter: blur(3px);
  animation: nv-a-fade .18s ease-out;
}
.is-inline .nv-auth__backdrop { display: none; }

/* ── the panel ────────────────────────────────────────────────────────── */

.nv-auth__panel {
  position: relative;
  width: 100%;
  max-width: 26rem;
  background: var(--nv-a-bg);
  border: 1px solid var(--nv-a-line);
  border-radius: var(--nv-a-radius) var(--nv-a-radius) 0 0;
  box-shadow: var(--nv-a-shadow);
  padding: 1.5rem 1.25rem 1.75rem;
  /* A sheet taller than the phone must scroll, not clip the submit button —
     the keyboard takes half the screen the moment the field is focused. */
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: nv-a-rise .26s cubic-bezier(.22, 1, .36, 1);
}

@media (min-width: 640px) {
  .nv-auth__panel {
    border-radius: var(--nv-a-radius);
    padding: 1.75rem 1.75rem 2rem;
  }
}

.is-inline .nv-auth__panel {
  max-width: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
  max-height: none;
  overflow: visible;
  animation: none;
}

/* The grab handle only means anything on the sheet. */
.nv-auth__grip {
  width: 2.5rem;
  height: .25rem;
  border-radius: 999px;
  background: var(--nv-a-line-strong);
  margin: -.4rem auto 1rem;
}
@media (min-width: 640px) { .nv-auth__grip { display: none; } }
.is-inline .nv-auth__grip { display: none; }

.nv-auth__close {
  position: absolute;
  inset-inline-end: .85rem;
  inset-block-start: .85rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--nv-a-muted);
  font-size: .95rem;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.nv-auth__close:hover { background: var(--nv-a-bg-sink); color: var(--nv-a-ink); }
.is-inline .nv-auth__close { display: none; }

/* ── header ───────────────────────────────────────────────────────────── */

.nv-auth__head { text-align: center; margin-bottom: 1.4rem; }
.is-inline .nv-auth__head { text-align: start; }

.nv-auth__mark {
  width: 3rem;
  height: 3rem;
  margin: 0 auto .85rem;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--nv-a-primary), var(--nv-a-secondary));
  color: var(--nv-a-primary-ink);
  font-size: 1.15rem;
  box-shadow: 0 8px 20px -8px var(--nv-a-ring);
}
.is-inline .nv-auth__mark { display: none; }

.nv-auth__title {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.4;
  margin: 0;
}
.is-inline .nv-auth__title { font-size: 1.6rem; }

.nv-auth__sub {
  font-size: .85rem;
  color: var(--nv-a-muted);
  margin: .4rem 0 0;
  line-height: 1.8;
}

/* The number they typed, echoed back on the code step. */
/* The number they typed, echoed back on the code step — in the same shapes
   they typed it, not converted to Persian numerals by the font. */
.nv-auth__phone {
  font-weight: 700;
  color: var(--nv-a-ink);
  font-family: var(--nv-a-latin);
}

/* ── steps ────────────────────────────────────────────────────────────── */

.nv-auth__step[hidden] { display: none; }
.nv-auth__step { animation: nv-a-slide .22s ease-out; }

/* ── fields ───────────────────────────────────────────────────────────── */

.nv-auth__label {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: .45rem;
}

.nv-auth__field { margin-bottom: 1rem; }
.nv-auth__field:last-of-type { margin-bottom: 0; }

.nv-auth__box {
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 1.5px solid var(--nv-a-line);
  border-radius: 12px;
  background: var(--nv-a-bg-soft);
  padding-inline: .75rem;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.nv-auth__box:focus-within {
  border-color: var(--nv-a-primary);
  background: var(--nv-a-bg);
  box-shadow: 0 0 0 3px var(--nv-a-ring);
}
.nv-auth__box.is-bad { border-color: var(--nv-a-bad); }
.nv-auth__box.is-ok  { border-color: var(--nv-a-ok); }

.nv-auth__box > input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding-block: .8rem;
}
.nv-auth__box > input::placeholder { color: var(--nv-a-muted); opacity: .7; }
.nv-auth__box > input.nv-auth__tel::placeholder,
.nv-auth__box > input.nv-auth__pass::placeholder {
  font-family: var(--nv-a-latin);
  letter-spacing: normal;
}

/* The phone number is Latin digits, left to right, inside an RTL page.
   Vazirmatn substitutes Persian shapes under lang="fa", so the input opts
   out of that with lang="en" AND the feature flags — the font honours one
   or the other depending on how it was subset. */
.nv-auth__box > input.nv-auth__tel,
.nv-auth__box > input.nv-auth__pass {
  direction: ltr;
  text-align: left;
  font-family: var(--nv-a-latin);
}
.nv-auth__box > input.nv-auth__tel {
  letter-spacing: .12em;
  font-size: 1.02rem;
  font-weight: 600;
}

/* The phone row is laid out left to right even on an RTL page, because a
   telephone number is: otherwise the country badge sits at the far right and
   the digits start at the far left with a gap between them, and the two read
   as unrelated things. */
.nv-auth__box--tel { direction: ltr; }

.nv-auth__prefix {
  flex: none;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--nv-a-muted);
  padding-inline-end: .6rem;
  border-inline-end: 1px solid var(--nv-a-line);
  direction: ltr;
}

/* The live tick beside the phone field. A wrapper that only toggles display,
   never <template x-if> and never a binding on the <i> itself: Font Awesome
   runs in SVG-with-JS mode and swaps every <i> for a fresh <svg>, so anything
   holding a reference to that <i> is left pointing at a detached node. */
.nv-auth__flag {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.25rem;
  font-size: .85rem;
}
.nv-auth__flag > span { display: none; }
.nv-auth__flag > span.is-on { display: block; }
.nv-auth__flag .nv-auth--ok { color: var(--nv-a-ok); }

.nv-auth__eye {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--nv-a-muted);
  cursor: pointer;
  padding: .35rem;
  font-size: .9rem;
  border-radius: 8px;
}
.nv-auth__eye:hover { color: var(--nv-a-ink); }
.nv-auth__eye { position: relative; }
/* `is-on` = the password is showing. The struck-through eye is not in the
   vendored subset, and a missing Font Awesome name renders an empty
   placeholder rather than erroring, so the slash is drawn here instead. */
.nv-auth__eye.is-on::after {
  content: '';
  position: absolute;
  inset-inline-start: 50%;
  inset-block-start: 50%;
  width: 1.15rem;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(-45deg);
  box-shadow: 0 -2px 0 0 var(--nv-a-bg-soft);
}
.nv-auth__eye.is-on { color: var(--nv-a-primary); }

.nv-auth__err {
  display: none;
  font-size: .78rem;
  color: var(--nv-a-bad);
  margin: .4rem 0 0;
  line-height: 1.7;
}
.nv-auth__err.is-on { display: block; }

.nv-auth__hint {
  font-size: .75rem;
  color: var(--nv-a-muted);
  margin: .4rem 0 0;
  line-height: 1.8;
}

/* ── the code boxes ───────────────────────────────────────────────────── */

/* The row spans the panel, exactly like every field above and below it.
   Centring a fixed-width row inside a wider panel is what made the code step
   look like two designs stacked on top of each other. */
.nv-auth__code {
  direction: ltr;          /* a code reads left to right, page direction or not */
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .25rem;
}

.nv-auth__digit {
  flex: 1 1 0;
  min-width: 0;
  /* Capped so six or seven boxes never become letterboxes, and floored so
     five never get too small to hit with a thumb. */
  max-width: 4rem;
  aspect-ratio: 1 / 1.12;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--nv-a-latin);
  color: var(--nv-a-ink);
  background: var(--nv-a-bg-soft);
  border: 1.5px solid var(--nv-a-line);
  border-radius: 12px;
  outline: 0;
  padding: 0;
  transition: border-color .14s ease, box-shadow .14s ease,
              background-color .14s ease, transform .14s ease;
  /* Chrome renders a spinner on a numeric field even with inputmode. */
  -moz-appearance: textfield;
}
.nv-auth__digit::-webkit-outer-spin-button,
.nv-auth__digit::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.nv-auth__digit:focus {
  border-color: var(--nv-a-primary);
  background: var(--nv-a-bg);
  box-shadow: 0 0 0 3px var(--nv-a-ring);
  transform: translateY(-2px);
}
.nv-auth__digit.is-filled { border-color: var(--nv-a-line-strong); background: var(--nv-a-bg); }
.nv-auth__code.is-bad .nv-auth__digit { border-color: var(--nv-a-bad); }
.nv-auth__code.is-ok  .nv-auth__digit { border-color: var(--nv-a-ok); }
.nv-auth__code.is-shaking { animation: nv-a-shake .4s ease; }

/* ── the countdown / resend row ───────────────────────────────────────── */

.nv-auth__resend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: .9rem;
  font-size: .78rem;
  color: var(--nv-a-muted);
}

.nv-auth__timer {
  font-variant-numeric: tabular-nums;
  direction: ltr;
  display: inline-block;
}

.nv-auth__linkbtn {
  border: 0;
  background: transparent;
  color: var(--nv-a-primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: .2rem .1rem;
  border-radius: 6px;
  text-decoration: none;
}
.nv-auth__linkbtn:hover:not(:disabled) { text-decoration: underline; }
.nv-auth__linkbtn:disabled { color: var(--nv-a-muted); cursor: default; }

/* ── buttons ──────────────────────────────────────────────────────────── */

.nv-auth__submit {
  width: 100%;
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .85rem 1rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--nv-a-primary), var(--nv-a-secondary));
  color: var(--nv-a-primary-ink);
  font: inherit;
  font-weight: 800;
  font-size: .95rem;
  cursor: pointer;
  box-shadow: 0 10px 24px -12px var(--nv-a-ring);
  transition: filter .15s ease, transform .12s ease, opacity .15s ease;
}
.nv-auth__submit:hover:not(:disabled) { filter: brightness(1.07); }
.nv-auth__submit:active:not(:disabled) { transform: translateY(1px); }
.nv-auth__submit:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.nv-auth__submit .nv-auth__spin { display: none; }
.nv-auth__submit.is-busy .nv-auth__spin { display: inline-block; animation: nv-a-spin 1s linear infinite; }

.nv-auth__alt {
  margin-top: 1rem;
  text-align: center;
  font-size: .8rem;
  color: var(--nv-a-muted);
}

.nv-auth__foot {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--nv-a-line);
  text-align: center;
  font-size: .74rem;
  line-height: 1.9;
  color: var(--nv-a-muted);
}
.nv-auth__foot a { color: var(--nv-a-primary); font-weight: 700; text-decoration: none; }
.nv-auth__foot a:hover { text-decoration: underline; }

/* ── names, for someone signing up ────────────────────────────────────── */

/* ── the name block, for a first-time visitor ─────────────────────────── */

/* Two ordinary fields, stacked, the same width and box as the phone field on
   step one. What this replaced was a two-column grid: two half-width inputs
   side by side, above a code row of a third width again — three widths on the
   one screen a new visitor sees. */
.nv-auth__names {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--nv-a-line);
}
.nv-auth__names[hidden] { display: none; }

/* Says why two more fields just appeared, so the screen reads as one request
   rather than as a form that grew. */
.nv-auth__legend {
  font-size: .82rem;
  color: var(--nv-a-muted);
  margin: 0 0 .9rem;
  line-height: 1.8;
}

/* ==========================================================================
   /auth/login — the split screen
   ========================================================================== */

.nv-login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--color-base-100, #fff);
  color: var(--color-base-content, #1c1c22);
}

@media (min-width: 960px) {
  .nv-login { grid-template-columns: 1.05fr .95fr; }
}

/* ── the brand half ───────────────────────────────────────────────────── */

.nv-login__brand {
  position: relative;
  overflow: hidden;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  color: #fff;
  background:
    radial-gradient(120% 90% at 85% 5%, rgba(255, 255, 255, .22) 0%, transparent 55%),
    linear-gradient(150deg,
      var(--color-primary, #4f39f6) 0%,
      color-mix(in oklab, var(--color-primary, #4f39f6) 60%, var(--color-secondary, #ec4899)) 55%,
      var(--color-secondary, #ec4899) 100%);
}
@media (min-width: 960px) { .nv-login__brand { display: flex; } }

/* Two soft blobs, drifting. Cheap (transform only) and decorative — the
   panel reads correctly with the animation off, which is what a visitor who
   asked for reduced motion gets. */
.nv-login__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: .45;
  pointer-events: none;
}
.nv-login__blob--a {
  width: 26rem; height: 26rem;
  background: #fff;
  inset-block-start: -8rem; inset-inline-end: -6rem;
  animation: nv-a-drift 16s ease-in-out infinite alternate;
}
.nv-login__blob--b {
  width: 20rem; height: 20rem;
  background: var(--color-accent, #5ee7d5);
  inset-block-end: -6rem; inset-inline-start: -4rem;
  opacity: .35;
  animation: nv-a-drift 21s ease-in-out infinite alternate-reverse;
}

.nv-login__brandinner { position: relative; z-index: 1; }

.nv-login__logo {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -.01em;
}
.nv-login__logo img { height: 2.4rem; width: auto; }

.nv-login__pitch {
  position: relative;
  z-index: 1;
  max-width: 30rem;
}
.nv-login__pitch h2 {
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  font-weight: 900;
  line-height: 1.55;
  margin: 0 0 1rem;
}
.nv-login__pitch p {
  font-size: .95rem;
  line-height: 2.1;
  margin: 0;
  opacity: .92;
}

.nv-login__points {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .7rem;
}
.nv-login__points li {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .87rem;
  font-weight: 600;
  opacity: .95;
}
.nv-login__points i {
  width: 1.6rem; height: 1.6rem;
  flex: none;
  display: grid; place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, .2);
  font-size: .7rem;
}

/* ── the form half ────────────────────────────────────────────────────── */

.nv-login__pane {
  /* The toolbar inside is absolute; without this it anchors to the viewport
     and lands on top of the brand panel, which is the other half of the
     screen. */
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1.25rem 2.5rem;
  min-width: 0;
}
@media (min-width: 640px) { .nv-login__pane { padding: 3rem 2.5rem; } }

.nv-login__form { width: 100%; max-width: 25rem; margin-inline: auto; }

/* The small logo that only shows when the brand half is not on screen. */
.nv-login__mobilelogo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  margin-bottom: 2rem;
  font-weight: 900;
  font-size: 1.2rem;
}
.nv-login__mobilelogo img { height: 2.6rem; width: auto; }
@media (min-width: 960px) { .nv-login__mobilelogo { display: none; } }

.nv-login__toolbar {
  position: absolute;
  inset-block-start: 1rem;
  inset-inline-start: 1rem;
  z-index: 5;
  display: flex;
  gap: .5rem;
}
.nv-login__tool {
  width: 2.25rem; height: 2.25rem;
  display: grid; place-items: center;
  border-radius: 999px;
  border: 1px solid var(--color-base-300, #e4e4e7);
  background: var(--color-base-100, #fff);
  color: var(--color-base-content, #1c1c22);
  cursor: pointer;
  font-size: .85rem;
  text-decoration: none;
  transition: background-color .15s ease;
}
.nv-login__tool:hover { background: var(--color-base-200, #fafafa); }

/* ── motion ───────────────────────────────────────────────────────────── */

@keyframes nv-a-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes nv-a-rise {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes nv-a-slide {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes nv-a-spin { to { transform: rotate(360deg); } }
@keyframes nv-a-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}
@keyframes nv-a-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-3rem, 2.5rem, 0) scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
  .nv-auth__panel,
  .nv-auth__step,
  .nv-auth__backdrop { animation: none; }
  .nv-login__blob { animation: none; }
  .nv-auth__code.is-shaking { animation: none; }
  .nv-auth__digit:focus { transform: none; }
  .nv-auth__submit.is-busy .nv-auth__spin { animation: nv-a-spin 1.6s linear infinite; }
}
