﻿/* ═══════════════════════════════════════════════════
   NEXADMIN — AUTH PAGES (login / register / forgot / reset / otp)
═══════════════════════════════════════════════════ */

/* ─── Variables (mirrors main style) ─── */
:root {
  --teal:   #4895ef;
  --teal-d: #3478d4;
  --purple: #7c3aed;
  --orange: #f97316;
  --pink:   #ec4899;
  --blue:   #3b82f6;
  --red:    #ef4444;
  --yellow: #eab308;
  --green:  #22c55e;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
}

:root,
[data-theme="dark"] {
  --bg:          #0c0e1d;
  --bg-card:     #131427;
  --bg-input:    rgba(255,255,255,.05);
  --bg-input-h:  rgba(255,255,255,.08);
  --border:      rgba(255,255,255,.07);
  --border-h:    rgba(255,255,255,.13);
  --border-act:  rgba(72,149,239,.45);
  --txt-1:       #edf0ff;
  --txt-2:       #8892b8;
  --txt-3:       #4a5172;
  --shadow:      0 20px 60px rgba(0,0,0,.5);
  --social-bg:   rgba(255,255,255,.04);
  --social-bdr:  rgba(255,255,255,.08);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg:          #f0f4fa;
  --bg-card:     #ffffff;
  --bg-input:    rgba(15,20,50,.04);
  --bg-input-h:  rgba(15,20,50,.07);
  --border:      rgba(15,20,50,.08);
  --border-h:    rgba(15,20,50,.14);
  --border-act:  rgba(52,120,212,.5);
  --txt-1:       #0f172a;
  --txt-2:       #4b5563;
  --txt-3:       #9ca3af;
  --shadow:      0 20px 60px rgba(15,20,50,.12);
  --social-bg:   rgba(15,20,50,.03);
  --social-bdr:  rgba(15,20,50,.09);
  color-scheme: light;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
input, textarea, select, option, optgroup, button {
  font-family: 'Vazirmatn', 'Inter', sans-serif;
}
body {
  font-family: 'Vazirmatn', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--txt-1);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background .25s, color .25s;
}
a { text-decoration: none; color: inherit; }
button { border: none; cursor: pointer; background: none; font-family: inherit; color: inherit; }
img { display: block; border-radius: 50%; max-width: 100%; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 4px; }

/* ─── Theme FAB ─── */
.theme-fab {
  position: fixed; inset-block-start: 0; inset-inline-end: 0; z-index: 999;
  width: 40px; height: 40px; border-radius: var(--r-md);
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--txt-2); font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  transition: all .2s;
}
.theme-fab:hover { color: var(--teal); border-color: var(--border-act); }

/* ═══════════════════════════════
   AUTH LAYOUT (split)
═══════════════════════════════ */
.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ══════════════════════════════════════
   LEFT PANEL — ABSTRACT GEOMETRIC
══════════════════════════════════════ */
.auth-visual {
  position: relative;
  overflow: hidden;
  /* Deep dark base */
  background-color: #06081a;
  /* Dot grid */
  background-image:
    radial-gradient(circle, rgba(72,149,239,.18) 1px, transparent 1px);
  background-size: 30px 30px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 36px 44px;
  /* Subtle radial glow behind center */
}
.auth-visual::before {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 46%, rgba(72,149,239,.07) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(124,58,237,.07) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 80% 10%, rgba(59,130,246,.05) 0%, transparent 60%);
  pointer-events: none;
}

/* ── Ambient corner glows ── */
.geo-glow-tl {
  position: absolute; top: -60px; left: -60px; z-index: 1;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(72,149,239,.14) 0%, transparent 70%);
  pointer-events: none;
  animation: glowPulse 5s ease-in-out infinite;
}
.geo-glow-br {
  position: absolute; bottom: -60px; right: -60px; z-index: 1;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,.1) 0%, transparent 70%);
  pointer-events: none;
  animation: glowPulse 5s ease-in-out infinite reverse;
}
@keyframes glowPulse {
  0%, 100% { opacity: .6; transform: scale(1); }
  50%       { opacity: 1;  transform: scale(1.12); }
}

/* ── HUD corner brackets ── */
.geo-bracket {
  position: absolute; z-index: 2;
  width: 28px; height: 28px;
}
.geo-bracket--tl { top: 24px;  left: 24px;  border-top: 2px solid var(--teal); border-inline-end: 2px solid var(--teal); }
.geo-bracket--tr { top: 24px;  right: 24px; border-top: 2px solid var(--teal); border-inline-start: 2px solid var(--teal); }
.geo-bracket--bl { bottom: 24px; left: 24px;  border-bottom: 2px solid rgba(72,149,239,.4); border-inline-end: 2px solid rgba(72,149,239,.4); }
.geo-bracket--br { bottom: 24px; right: 24px; border-bottom: 2px solid rgba(72,149,239,.4); border-inline-start: 2px solid rgba(72,149,239,.4); }

/* ── Cross lines ── */
.geo-h-line {
  position: absolute; z-index: 1;
  left: 8%; right: 8%;
  top: calc(44% - 0.5px); height: 1px;
  background: linear-gradient(90deg, transparent, rgba(72,149,239,.35) 20%, rgba(72,149,239,.5) 50%, rgba(72,149,239,.35) 80%, transparent);
  overflow: visible;
}
.geo-v-line {
  position: absolute; z-index: 1;
  top: 12%; bottom: 24%;
  left: calc(50% - 0.5px); width: 1px;
  background: linear-gradient(180deg, transparent, rgba(72,149,239,.35) 20%, rgba(72,149,239,.5) 50%, rgba(72,149,239,.35) 80%, transparent);
  overflow: visible;
}

/* Animated data packets on lines */
.geo-packet {
  position: absolute;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal), 0 0 16px rgba(72,149,239,.6);
}
.geo-packet--ltr {
  top: -2px;
  animation: packetLTR 3.5s linear infinite;
}
.geo-packet--ttb {
  left: -2px;
  animation: packetTTB 4s linear infinite 1.2s;
}
@keyframes packetLTR {
  0%   { inset-inline-start: 0;    opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
@keyframes packetTTB {
  0%   { top: 0;    opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ── Stat nodes ── */
.geo-node {
  position: absolute; z-index: 3;
  display: flex; align-items: center;
}

/* Top node */
.geo-node--top {
  top: 12%; left: 50%;
  transform: translateX(-50%);
  flex-direction: column; align-items: center; gap: 8px;
}
/* Right node */
.geo-node--right {
  top: 44%; right: 5%;
  transform: translateY(-50%);
  flex-direction: row; gap: 10px;
}
/* Bottom node */
.geo-node--bottom {
  bottom: 24%; left: 50%;
  transform: translateX(-50%);
  flex-direction: column-reverse; align-items: center; gap: 8px;
}
/* Left node */
.geo-node--left {
  top: 44%; left: 5%;
  transform: translateY(-50%);
  flex-direction: row-reverse; gap: 10px;
}

/* Node dot (intersection marker) */
.geo-node-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  background: var(--teal);
  box-shadow: 0 0 10px var(--teal), 0 0 20px rgba(72,149,239,.5);
  position: relative;
}
.geo-node-dot::before {
  content: '';
  position: absolute; inset: -4px;
  border-radius: 50%; border: 1px solid rgba(72,149,239,.4);
  animation: dotPing 2s ease-out infinite;
}
@keyframes dotPing {
  0%   { transform: scale(1); opacity: .8; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* Node info card */
.geo-node-inner {
  background: rgba(6,8,26,.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(72,149,239,.2);
  border-radius: var(--r-md);
  padding: 10px 14px;
  display: flex; flex-direction: column; gap: 3px; text-align: center;
  min-width: 100px;
}
.geo-node-inner--right { text-align: center;  }
.geo-node-inner--left  { text-align: center; }

.gni-val {
  display: block; font-size: 1.05rem; font-weight: 800;
  color: #fff; line-height: 1;
  text-shadow: 0 0 14px rgba(72,149,239,.5);
}
.gni-lbl {
  display: block; font-size: .65rem; color: rgba(255,255,255,.45);
  text-transform: uppercase; letter-spacing: .05em;
}
.gni-trend {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: .64rem; font-weight: 700;
  padding: 1px 7px; border-radius: 20px; margin-top: 4px;
  align-self: center;
}
.geo-node-inner--right .gni-trend,
.geo-node-inner--left  .gni-trend { align-self: flex-start; }
.gni-trend.up   { background: rgba(72,149,239,.12); color: var(--teal); }
.gni-trend.down { background: rgba(239,68,68,.12);  color: var(--red); }

/* ── Central hex / logo ── */
.geo-center {
  position: absolute; z-index: 4;
  top: 44%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
}

.geo-ring {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(72,149,239,.2);
}
.geo-ring--1 {
  width: 70px; height: 70px;
  border-color: rgba(72,149,239,.35);
  animation: spin 12s linear infinite;
}
.geo-ring--1::before {
  content: '';
  position: absolute; top: -3px; left: 50%; margin-inline-start: -3px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal); box-shadow: 0 0 8px var(--teal);
}
.geo-ring--2 {
  width: 96px; height: 96px;
  border-color: rgba(72,149,239,.15);
  animation: spin 20s linear infinite reverse;
}
.geo-ring--2::before {
  content: '';
  position: absolute; bottom: -3px; left: 50%; margin-inline-start: -3px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--purple); box-shadow: 0 0 8px var(--purple);
}
.geo-ring--3 {
  width: 128px; height: 128px;
  border-color: rgba(124,58,237,.12);
  border-style: dashed;
  animation: spin 35s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.geo-core {
  width: 52px; height: 52px; border-radius: 16px; position: relative; z-index: 2;
  background: linear-gradient(135deg, #0d1e2e, #130f24);
  border: 1px solid rgba(72,149,239,.4);
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    0 0 0 1px rgba(72,149,239,.1),
    0 0 20px rgba(72,149,239,.25),
    0 0 50px rgba(72,149,239,.1),
    inset 0 0 20px rgba(72,149,239,.05);
}

/* ── Brand (bottom) ── */
.geo-brand {
  position: relative; z-index: 5;
  display: flex; align-items: center; gap: 11px;
  margin-top: auto;
}
.geo-brand-logo {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--teal), var(--purple));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(72,149,239,.3);
}
.geo-brand-name {
  display: block; font-size: 1rem; font-weight: 800;
  background: linear-gradient(90deg, var(--teal), #a0c4ff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.geo-brand-tag { display: block; font-size: .66rem; color: rgba(255,255,255,.35); margin-top: 1px; }

/* ── RIGHT FORM PANEL ── */
.auth-form-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
  background: var(--bg);
  transition: background .25s;
}

.auth-card {
  width: 100%; max-width: 420px;
  animation: cardIn .4s cubic-bezier(.4,0,.2,1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Brand logo at top of auth card */
.auth-card-logo {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 28px; text-align: center;
}
.acl-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, var(--teal), var(--purple));
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.acl-logo-img { width: 52px; height: 52px; border-radius: 12px; object-fit: contain; }
.acl-name { display: block; font-size: 1.05rem; font-weight: 800; color: var(--txt-1); }
.acl-tag  { display: block; font-size: .78rem; color: var(--txt-2); margin-top: 3px; }

.auth-title {
  font-size: 1.75rem; font-weight: 800; color: var(--txt-1); line-height: 1.2; margin-bottom: 7px;
}
.auth-sub { font-size: .85rem; color: var(--txt-2); margin-bottom: 30px; line-height: 1.5; }

/* ── Form ── */
.auth-form { display: flex; flex-direction: column; gap: 18px; }

.form-group { display: flex; flex-direction: column; gap: 7px; }

.form-label {
  font-size: .8rem; font-weight: 600; color: var(--txt-2);
}
.form-label-row { display: flex; justify-content: space-between; align-items: center; }
.form-label-link { font-size: .78rem; color: var(--teal); font-weight: 500; transition: opacity .15s; }
.form-label-link:hover { opacity: .8; }

.input-wrap {
  position: relative; display: flex; align-items: center;
}
.input-ico {
  position: absolute; inset-inline-start: 13px;
  color: var(--txt-3); font-size: .85rem; pointer-events: none;
  transition: color .2s;
}
.form-input {
  width: 100%; background: var(--bg-input); border: 1.5px solid var(--border);
  border-radius: var(--r-md); padding: 12px 14px;
  padding-inline-start: 40px; padding-inline-end: 40px;
  color: var(--txt-1); font-size: .875rem; outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
  -webkit-appearance: none;
}
.form-input::placeholder { color: var(--txt-3); }
.form-input:hover { border-color: var(--border-h); background: var(--bg-input-h); }
.form-input:focus {
  border-color: var(--border-act);
  background: var(--bg-input-h);
  box-shadow: 0 0 0 3px rgba(72,149,239,.12);
}
.form-input:focus ~ .input-ico,
.input-wrap:focus-within .input-ico { color: var(--teal); }

/* Password toggle */
.input-toggle-pw {
  position: absolute; inset-inline-end: 12px;
  color: var(--txt-3); font-size: .85rem;
  padding: 4px; transition: color .15s;
}
.input-toggle-pw:hover { color: var(--teal); }

/* Validation states */
.form-group.error .form-input   { border-color: var(--red); box-shadow: 0 0 0 3px rgba(239,68,68,.1); }
.form-group.success .form-input { border-color: var(--teal); }
.form-error { font-size: .73rem; color: var(--red); min-height: 16px; display: flex; align-items: center; gap: 5px; }
.form-error:not(:empty)::before { content: '\f06a'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: .65rem; }

/* Custom checkbox */
.form-row-check { display: flex; align-items: center; }
.check-label { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.check-input { display: none; }
.check-box {
  width: 17px; height: 17px; border-radius: 5px;
  border: 1.5px solid var(--border-h); flex-shrink: 0;
  background: var(--bg-input); position: relative;
  transition: all .18s;
}
.check-input:checked + .check-box {
  background: var(--teal); border-color: var(--teal);
}
.check-input:checked + .check-box::after {
  content: ''; position: absolute;
  top: 2px; left: 5px; width: 5px; height: 9px;
  border: 2px solid #ffffff; border-top: none; border-inline-start: none;
  transform: rotate(45deg);
}
.check-text { font-size: .8rem; color: var(--txt-2); }

/* Submit button */
.btn-auth {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--teal), #74b9ff);
  color: #ffffff; font-size: .9rem; font-weight: 700;
  border-radius: var(--r-md); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 18px rgba(72,149,239,.3);
  transition: all .2s;
  position: relative; overflow: hidden;
}
.btn-auth::before {
  content: '';
  position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.15), transparent);
  transition: left .5s;
}
.btn-auth:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(72,149,239,.4); }
.btn-auth:hover::before { left: 100%; }
.btn-auth:active { transform: translateY(0); }
.btn-auth.loading { opacity: .75; pointer-events: none; }

/* Divider */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  font-size: .75rem; color: var(--txt-3);
}
.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Social buttons */
.social-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.social-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 11px; border-radius: var(--r-md); cursor: pointer;
  background: var(--social-bg); border: 1.5px solid var(--social-bdr);
  color: var(--txt-1); font-size: .82rem; font-weight: 600;
  transition: all .18s;
}
.social-btn:hover { background: var(--bg-input-h); border-color: var(--border-h); transform: translateY(-1px); }
.social-btn i { font-size: 1rem; }

/* Footer link */
.auth-footer-link {
  margin-top: 24px; text-align: center;
  font-size: .82rem; color: var(--txt-2);
}
.auth-footer-link a {
  color: var(--teal); font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px;
  transition: gap .18s;
}
.auth-footer-link a:hover { gap: 8px; }

/* ── Back link (for sub-pages) ── */
.auth-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; color: var(--txt-2); margin-bottom: 28px;
  transition: color .15s, gap .18s;
}
.auth-back:hover { color: var(--teal); gap: 11px; }

/* ── Page icon (for forgot / otp / reset) ── */
.auth-page-icon {
  width: 64px; height: 64px; border-radius: var(--r-lg); margin-bottom: 22px;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.api--teal   { background: rgba(72,149,239,.12); color: var(--teal); }
.api--purple { background: rgba(124,58,237,.12); color: #a78bfa; }
.api--orange { background: rgba(249,115,22,.12); color: var(--orange); }
.api--blue   { background: rgba(59,130,246,.12); color: var(--blue); }

/* ── OTP inputs ── */
.otp-row {
  display: flex; gap: 10px; justify-content: center; margin-bottom: 4px;
}
.otp-input {
  width: 52px; height: 58px;
  background: var(--bg-input); border: 1.5px solid var(--border);
  border-radius: var(--r-md); text-align: center;
  font-size: 1.4rem; font-weight: 700; color: var(--txt-1);
  outline: none; transition: all .2s; caret-color: var(--teal);
}
.otp-input:focus {
  border-color: var(--border-act);
  background: var(--bg-input-h);
  box-shadow: 0 0 0 3px rgba(72,149,239,.12);
}
.otp-input.filled {
  border-color: var(--border-act); background: rgba(72,149,239,.05);
  color: var(--teal);
}

.otp-resend {
  text-align: center; font-size: .8rem; color: var(--txt-2); margin-top: 10px;
}
.otp-resend button {
  color: var(--teal); font-weight: 600; font-size: .8rem; transition: opacity .15s;
}
.otp-resend button:hover { opacity: .75; }
.otp-timer { font-weight: 600; color: var(--orange); }

/* ── Password strength bar ── */
.pw-strength { margin-top: 6px; }
.pw-strength-bar {
  display: flex; gap: 4px; margin-bottom: 6px;
}
.pw-seg {
  flex: 1; height: 3px; border-radius: 3px;
  background: var(--border-h); transition: background .3s;
}
.pw-seg.weak   { background: var(--red); }
.pw-seg.fair   { background: var(--orange); }
.pw-seg.good   { background: var(--yellow); }
.pw-seg.strong { background: var(--teal); }

.pw-strength-txt { font-size: .72rem; color: var(--txt-3); }
.pw-strength-txt.weak   { color: var(--red); }
.pw-strength-txt.fair   { color: var(--orange); }
.pw-strength-txt.good   { color: var(--yellow); }
.pw-strength-txt.strong { color: var(--teal); }

/* ── Password requirements list (reset page) ── */
.pw-requirements {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--r-md); margin-top: -4px;
}
.pwr-item {
  display: flex; align-items: center; gap: 8px;
  font-size: .76rem; color: var(--txt-3); transition: color .2s;
}
.pwr-item i { font-size: .75rem; color: var(--txt-3); transition: color .2s; }
.pwr-item.ok       { color: var(--teal); }
.pwr-item.ok i     { color: var(--teal); }

/* The geometric left panel stays dark regardless of theme */
[data-theme="light"] .auth-visual {
  background-color: #06081a;
}

/* ═══════════════════════════════
   RESPONSIVE
═══════════════════════════════ */
@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-visual  { display: none; }
  .auth-form-wrap { min-height: 100vh; padding: 32px 20px; align-items: flex-start; padding-top: 70px; }
  .auth-title { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .auth-form-wrap { padding: 60px 16px 30px; }
  .social-row { grid-template-columns: 1fr; }
  .otp-input { width: 44px; height: 52px; font-size: 1.2rem; }
  .otp-row { gap: 8px; }
}

@media (min-width: 1400px) {
  .auth-visual { padding: 52px 60px; }
  .av-title    { font-size: 2.6rem; }
  .auth-card   { max-width: 460px; }
}
