/* ==========================================================================
   Auth pages: login, register, forgot password.
   Everything is scoped under .na so it never collides with style.css.
   The one signature element is the shoe-size measuring tape on the dark panel.
   ========================================================================== */

.na {
  --na-ink: #1c1a17;
  --na-dim: #5c5750;
  --na-faint: #6f695f;
  --na-line: rgba(20, 18, 14, .16);
  --na-line-soft: rgba(20, 18, 14, .08);
  --na-paper: #f7f5f1;
  --na-card: #fff;
  --na-dark: #14120f;
  --na-accent: #2f3fe0;
  --na-accent-soft: rgba(47, 63, 224, .14);
  --na-danger: #a73535;
  --na-danger-bg: rgba(201, 76, 76, .07);
  --na-ok: #276b3b;
  --na-ok-bg: rgba(64, 150, 86, .08);
  font-family: var(--site-font, 'Vazirmatn', Tahoma, sans-serif);
  color: var(--na-ink);
}

.na *, .na *::before, .na *::after { box-sizing: border-box; }

.na-wrap {
  display: flex;
  justify-content: center;
  padding: 40px 20px 72px;
}

.na-card {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  width: 100%;
  max-width: 1040px;
  min-height: 660px;
  background: var(--na-card);
  border: 1px solid var(--na-line-soft);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 40px 90px -40px rgba(28, 26, 23, .28);
}

/* ---------- Dark panel + measuring tape ---------- */

.na-visual {
  position: relative;
  padding: 56px 48px;
  background: var(--na-dark);
  color: #f5f2ec;
}

.na-visual-copy { position: relative; z-index: 1; max-width: 250px; }
.na-visual-title { text-wrap: balance; margin: 0 0 14px; font-size: 34px; line-height: 1.5; font-weight: 800; letter-spacing: -.01em; }
.na-visual-text { margin: 0; font-size: 14px; line-height: 2.05; color: rgba(245, 242, 236, .7); }

.na-tape { position: absolute; top: 36px; bottom: 0; inset-inline-end: 0; width: 92px; }
.na-tape ol { display: flex; flex-direction: column; height: 100%; margin: 0; padding: 0; list-style: none; }
.na-tape li { position: relative; flex: 1 1 0; min-height: 0; }

/* major tick */
.na-tape li::before {
  content: "";
  position: absolute; top: 0; inset-inline-end: 0;
  width: 38px; height: 2px;
  background: rgba(245, 242, 236, .55);
}
/* four minor ticks between majors */
.na-tape li::after {
  content: "";
  position: absolute; top: 0; bottom: 0; inset-inline-end: 0;
  width: 18px;
  background: repeating-linear-gradient(to bottom,
    transparent 0, transparent calc(20% - 1px),
    rgba(245, 242, 236, .28) calc(20% - 1px), rgba(245, 242, 236, .28) 20%);
}
.na-tape li span {
  position: absolute; top: 0; inset-inline-end: 50px;
  transform: translateY(-50%);
  font-size: 12.5px; line-height: 1; font-weight: 700;
  color: rgba(245, 242, 236, .62);
  font-variant-numeric: tabular-nums;
}

.na-tape-mark {
  position: absolute;
  top: calc(100% * var(--i) / 11);
  inset-inline-end: 0;
  width: 92px; height: 2px;
  background: var(--na-accent);
  animation: na-drop 1.1s cubic-bezier(.16, 1, .3, 1) .2s both;
}
.na-tape-mark b {
  position: absolute; top: 50%; inset-inline-end: 46px;
  transform: translateY(-50%);
  min-width: 40px; padding: 3px 9px;
  border-radius: 8px;
  background: var(--na-accent); color: #fff;
  font-size: 13px; line-height: 1.5; font-weight: 800; text-align: center;
}

@keyframes na-drop { from { top: 0; } }
@keyframes na-drop-x { from { inset-inline-start: 0; } }
@keyframes na-spin { to { transform: rotate(360deg); } }
@keyframes na-shake {
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* ---------- Form column ---------- */

.na-main { display: flex; flex-direction: column; justify-content: center; padding: 36px 48px 44px; min-width: 0; }
.na-main-in { width: 100%; max-width: 460px; margin: 0 auto; }

.na-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 34px; }
.na-logo { display: inline-flex; align-items: center; color: var(--na-ink); text-decoration: none; }
.na-logo img { display: block; width: auto; height: 38px; max-width: 150px; object-fit: contain; }
.na-logo-text { font-size: 19px; font-weight: 900; letter-spacing: -.01em; }
.na-back { display: inline-flex; align-items: center; gap: 7px; padding: 6px 2px; font-size: 12.5px; color: var(--na-dim); text-decoration: none; transition: color .2s; }
.na-back:hover { color: var(--na-ink); }
.na-back i { font-size: 11px; }

.na-h1 { margin: 0; font-size: 30px; line-height: 1.4; font-weight: 800; letter-spacing: -.015em; color: var(--na-ink); }
.na-sub { max-width: 42ch; margin: 8px 0 26px; font-size: 14px; line-height: 2; color: var(--na-dim); text-wrap: pretty; }

/* fields */
.na-field { min-width: 0; margin: 0 0 16px; }
.na-field label, .na .novin-captcha label {
  display: block; margin: 0 0 7px;
  font-size: 13px; font-weight: 600; color: var(--na-ink);
}
.na-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }

.na-control { position: relative; }
.na-control > i {
  position: absolute; top: 50%; inset-inline-start: 15px;
  transform: translateY(-50%);
  font-size: 14px; color: var(--na-faint);
  pointer-events: none; transition: color .2s;
}
.na-control:focus-within > i { color: var(--na-accent); }

.na-control input,
.na .novin-captcha-row input {
  display: block; width: 100%; height: 52px;
  padding-block: 0; padding-inline: 44px 14px;
  background: #fff;
  border: 1px solid var(--na-line); border-radius: 14px;
  color: var(--na-ink); font-size: 15px;
  outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .2s, box-shadow .2s;
}
.na-control.has-toggle input { padding-inline-end: 48px; }
.na-control input::placeholder { color: var(--na-faint); opacity: .8; }
.na-control input:focus,
.na .novin-captcha-row input:focus {
  border-color: var(--na-accent);
  box-shadow: 0 0 0 4px var(--na-accent-soft);
}
.na-control input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #fff inset; -webkit-text-fill-color: var(--na-ink); }

.na-eye {
  position: absolute; top: 50%; inset-inline-end: 6px;
  transform: translateY(-50%);
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border: 0; border-radius: 10px; background: transparent;
  color: var(--na-faint); font-size: 14px; cursor: pointer;
  transition: color .2s, background .2s;
}
.na-eye:hover { color: var(--na-ink); background: rgba(20, 18, 14, .05); }

.na-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; align-items: start; }

/* password strength: a small ruler that fills up */
.na-meter { display: flex; align-items: center; gap: 10px; min-height: 18px; margin-top: 9px; font-size: 12px; color: var(--na-faint); }
.na-meter-ticks { display: flex; align-items: flex-end; gap: 5px; }
.na-meter-ticks i { width: 3px; height: 9px; border-radius: 2px; background: var(--na-line); transition: background .2s; }
.na-meter-ticks i:nth-child(odd) { height: 14px; }
.na-meter[data-level="1"] i.on { background: #c94c4c; }
.na-meter[data-level="2"] i.on { background: #c98a1b; }
.na-meter[data-level="3"] i.on { background: #2f8a4c; }
.na-meter[data-level="1"] span { color: #a73535; }
.na-meter[data-level="3"] span { color: #276b3b; }

.na-hint { min-height: 18px; margin-top: 7px; font-size: 12px; color: var(--na-faint); }
.na-hint.is-ok { color: var(--na-ok); }
.na-hint.is-bad { color: var(--na-danger); }

/* captcha markup comes from novin_captcha_field(); restyle it here */
.na .novin-captcha { margin: 2px 0 20px; }
.na .novin-captcha-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: stretch; }
.na .novin-captcha-question {
  display: flex; align-items: center; justify-content: center;
  min-width: 0; min-height: 52px; padding: 0 18px;
  border: 1px dashed rgba(20, 18, 14, .3); border-radius: 14px;
  background: var(--na-paper);
  font-size: 16px; font-weight: 800; letter-spacing: .04em; white-space: nowrap;
  font-variant-numeric: tabular-nums; direction: ltr;
}
.na .novin-captcha-row input { min-width: 0; padding-inline: 14px; text-align: center; font-size: 16px; font-weight: 700; direction: ltr; }
.na .novin-captcha .form-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--na-faint); opacity: 1; }

/* alerts */
.na-alert {
  display: flex; align-items: flex-start; gap: 11px;
  margin: 0 0 18px; padding: 12px 14px;
  border: 1px solid; border-radius: 14px;
  font-size: 13px; line-height: 1.9; font-weight: 600;
}
.na-alert > i { margin-top: 6px; font-size: 14px; }
.na-alert p { margin: 0; }
.na-alert.is-error { background: var(--na-danger-bg); border-color: rgba(201, 76, 76, .3); color: var(--na-danger); }
.na-alert.is-ok { background: var(--na-ok-bg); border-color: rgba(64, 150, 86, .3); color: var(--na-ok); }

/* buttons + links */
.na-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; height: 54px; padding: 0 20px;
  border: 1px solid var(--na-ink); border-radius: 14px;
  background: var(--na-ink); color: #fff;
  font-family: inherit; font-size: 15px; font-weight: 700;
  text-decoration: none; cursor: pointer;
  transition: background .2s, transform .12s;
}
.na-btn:hover { background: #000; }
.na-btn:active { transform: translateY(1px); }
.na-btn.is-ghost { background: transparent; color: var(--na-ink); border-color: var(--na-line); }
.na-btn.is-ghost:hover { background: var(--na-paper); }
.na-btn.is-loading { color: transparent; pointer-events: none; }
.na-btn.is-loading::after {
  content: ""; position: absolute;
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: na-spin .7s linear infinite;
}

.na-link {
  color: var(--na-ink); font-size: 13px; font-weight: 700;
  text-decoration: underline; text-decoration-color: rgba(20, 18, 14, .3); text-underline-offset: 4px;
  transition: color .2s, text-decoration-color .2s;
}
.na-link:hover { color: var(--na-accent); text-decoration-color: currentColor; }
.na-label-row .na-link { font-size: 12.5px; font-weight: 600; color: var(--na-dim); }
.na-link-btn {
  padding: 4px 2px; border: 0; background: none;
  font: inherit; font-weight: 700; color: var(--na-ink);
  text-decoration: underline; text-decoration-color: rgba(20, 18, 14, .3); text-underline-offset: 4px;
  cursor: pointer;
}
.na-link-btn:hover { color: var(--na-accent); }

.na-alt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 22px 0 0; padding: 14px 16px;
  border-radius: 14px; background: var(--na-paper);
  font-size: 13.5px; color: var(--na-dim);
}
.na-alt .na-link i { margin-inline-start: 6px; font-size: 11px; }

.na-legal { margin: 14px 0 0; font-size: 12px; line-height: 2; text-align: center; color: var(--na-faint); }
.na-legal a { color: var(--na-dim); text-decoration: underline; text-underline-offset: 3px; }
.na-legal a:hover { color: var(--na-accent); }

/* OTP */
.na-otp-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 6px 0 22px; direction: ltr; }
.na-otp-digit {
  width: 100%; height: 62px; padding: 0;
  border: 1px solid var(--na-line); border-radius: 14px; background: #fff;
  color: var(--na-ink); font-family: inherit; font-size: 24px; font-weight: 800; text-align: center;
  caret-color: var(--na-accent); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.na-otp-digit:focus { border-color: var(--na-accent); box-shadow: 0 0 0 4px var(--na-accent-soft); }
.na-otp-digit.is-filled { border-color: var(--na-ink); }
.na-otp.has-error .na-otp-digit { border-color: rgba(201, 76, 76, .6); animation: na-shake .4s; }
.na-resend { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 16px 0 0; font-size: 13.5px; color: var(--na-dim); }

/* forgot password: sent state */
.na-sent { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.na-sent-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--na-dark); color: #fff; font-size: 22px; }
.na-sent-text { margin: 0; font-size: 14.5px; line-height: 2; color: var(--na-ink); text-wrap: pretty; }
.na-sent-mail { align-self: flex-start; max-width: 100%; margin: 0; padding: 6px 12px; border-radius: 10px; background: var(--na-paper); font-size: 14px; font-weight: 700; direction: ltr; overflow-wrap: anywhere; }
.na-sent-notes { display: grid; gap: 8px; margin: 2px 0 8px; padding: 0; list-style: none; font-size: 13px; line-height: 1.9; color: var(--na-dim); }
.na-sent-notes li { display: flex; gap: 9px; }
.na-sent-notes i { margin-top: 6px; font-size: 12px; color: var(--na-faint); }
.na-sent-actions { display: grid; gap: 10px; }

/* keyboard focus */
.na a:focus-visible, .na button:focus-visible { outline: 2px solid var(--na-accent); outline-offset: 3px; border-radius: 8px; }

/* ---------- Tablet / mobile: the panel becomes a horizontal tape ---------- */

@media (max-width: 900px) {
  .na-wrap { padding: 16px 14px 56px; }
  .na-card { grid-template-columns: 1fr; min-height: 0; border-radius: 24px; }

  .na-visual { height: 78px; padding: 0; }
  .na-visual-copy { display: none; }

  .na-tape { top: 0; bottom: 0; inset-inline: 0; width: auto; }
  .na-tape ol { flex-direction: row; }
  .na-tape li::before { top: auto; bottom: 0; inset-inline-end: auto; inset-inline-start: 0; width: 2px; height: 24px; }
  .na-tape li::after {
    top: auto; bottom: 0; inset-inline-end: auto; inset-inline-start: 0;
    width: 100%; height: 11px;
    background: repeating-linear-gradient(to left,
      transparent 0, transparent calc(20% - 1px),
      rgba(245, 242, 236, .28) calc(20% - 1px), rgba(245, 242, 236, .28) 20%);
  }
  .na-tape li span { top: 12px; inset-inline-end: auto; inset-inline-start: 8px; transform: none; }

  .na-tape-mark {
    top: 0; bottom: 0; inset-inline-end: auto;
    inset-inline-start: calc(100% * var(--i) / 11);
    width: 2px; height: auto;
    animation-name: na-drop-x;
  }
  .na-tape-mark b { top: 8px; inset-inline-end: auto; inset-inline-start: 0; transform: none; }

  .na-main { padding: 26px 24px 32px; }
  .na-top { margin-bottom: 26px; }
}

@media (max-width: 560px) {
  .na-main { padding: 24px 18px 28px; }
  .na-h1 { font-size: 25px; }
  .na-sub { font-size: 13.5px; }
  .na-grid { grid-template-columns: 1fr; }
  .na-otp-row { gap: 6px; }
  .na-otp-digit { height: 54px; font-size: 21px; }
  .na-alt { flex-direction: column; align-items: flex-start; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .na *, .na *::before, .na *::after { animation: none !important; transition: none !important; }
}
