/* ============================================================ */
/*  auth.css — استایل صفحه ورود و ثبت‌نام                       */
/*  پالت جدید: فیروزه‌ای (#00d4ff) + بنفش (#7c3aed)             */
/* ============================================================ */

:root {
  --bg: #050a15;
  --panel: #0a1428;
  --panel-2: #101e38;
  --line: #2d3668;
  --ink: #e8f0f8;
  --mute: #8ba0b8;
  --faint: #5a7090;
  --brand: #00d4ff;
  --brand-hi: #4dabff;
  --brand-2: #7c3aed;
  --plan: #f59e0b;
  --actual: #00d4aa;
  --danger: #ff5d8f;
  --glow: 0 0 40px rgba(0,212,255,.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ─── پس‌زمینه گرادیانت متحرک ─── */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 20% 20%, rgba(0,212,255,.25), transparent 40%),
    radial-gradient(circle at 80% 30%, rgba(124,58,237,.25), transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(77,171,255,.2), transparent 50%),
    linear-gradient(135deg, #050a15, #0a1428, #050a15);
  background-size: 200% 200%;
  animation: bgShift 20s ease infinite;
}
@keyframes bgShift {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
}

/* ─── ذرات نورانی ─── */
#particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 10px var(--brand);
  animation: float-particle linear infinite;
}
@keyframes float-particle {
  0%   { transform: translate(0,0) scale(1); opacity: 0; }
  10%  { opacity: .8; }
  90%  { opacity: .4; }
  100% { transform: translate(var(--dx, 30px), -100vh) scale(.3); opacity: 0; }
}

/* ─── Layout دو ستونی ─── */
.auth-layout {
  display: grid;
  grid-template-columns: minmax(360px, 500px) 1fr;
  min-height: 100vh;
}

/* ─── ستون فرم ─── */
.auth-side {
  background: rgba(10,20,40,.55);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  position: relative;
  z-index: 2;
}

.brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 2.75rem; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(0,212,255,.35);
}
.brand-name { font-weight: 800; font-size: 1.05rem; line-height: 1.3; }
.brand-ver  { font-size: .75rem; color: var(--faint); }

h1 { font-size: 1.65rem; font-weight: 800; margin-bottom: .4rem; }
.lead { color: var(--mute); font-size: .9rem; line-height: 1.9; margin-bottom: 2rem; }

/* ─── فرم ─── */
.field { margin-bottom: 1.15rem; }
.field label {
  display: block; font-size: .82rem; font-weight: 600;
  color: var(--mute); margin-bottom: .45rem;
}

.control { position: relative; }
.control input {
  width: 100%; height: 50px;
  padding: 0 3rem 0 1rem;
  background: rgba(5,10,21,.7);
  color: var(--ink);
  font: inherit; font-size: .95rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.control input::placeholder { color: var(--faint); }
.control input:hover { border-color: #3d4a8a; }
.control input:focus {
  outline: none;
  border-color: var(--brand);
  background: rgba(5,10,21,.95);
  box-shadow: 0 0 0 4px rgba(0,212,255,.15), var(--glow);
}
.control .ico {
  position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
  color: var(--faint); pointer-events: none; display: flex;
}
.control input:focus ~ .ico { color: var(--brand-hi); }

#password { padding-left: 3rem; }
#email    { direction: ltr; text-align: right; }

.eye {
  position: absolute; left: .4rem; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: 0; background: none;
  color: var(--faint); border-radius: 8px; cursor: pointer;
  display: grid; place-items: center;
}
.eye:hover { color: var(--ink); background: var(--panel-2); }
.eye:focus-visible,
.link:focus-visible,
.check input:focus-visible + .box,
.btn:focus-visible {
  outline: 2px solid var(--brand-hi); outline-offset: 2px;
}

.hint {
  font-size: .76rem; margin-top: .4rem;
  min-height: 1.1em; color: var(--plan);
  display: none;
}
.hint.on { display: block; }

/* ─── ردیف remember / forgot ─── */
.row {
  display: flex; justify-content: space-between; align-items: center;
  margin: .25rem 0 1.5rem; font-size: .84rem;
}
.check {
  display: flex; align-items: center; gap: .55rem;
  cursor: pointer; color: var(--mute); user-select: none;
}
.check input { position: absolute; opacity: 0; }
.check .box {
  width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--line); background: var(--bg);
  display: grid; place-items: center; transition: .15s;
}
.check .box svg { opacity: 0; transform: scale(.6); transition: .15s; }
.check input:checked + .box {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: var(--brand);
}
.check input:checked + .box svg { opacity: 1; transform: scale(1); }

.link {
  color: var(--brand-hi); background: none; border: 0;
  font: inherit; cursor: pointer; text-decoration: none;
}
.link:hover { text-decoration: underline; color: var(--brand); }

/* ─── Alert ─── */
.alert {
  display: none; gap: .6rem; align-items: flex-start;
  padding: .8rem 1rem; margin-bottom: 1.1rem;
  border-radius: 12px; font-size: .84rem; line-height: 1.8;
  background: rgba(255,93,143,.1);
  border: 1px solid rgba(255,93,143,.4);
  color: #ffc2d4;
}
.alert.on { display: flex; }
.alert.info {
  background: rgba(0,212,255,.1);
  border-color: rgba(0,212,255,.4);
  color: #c9eaff;
}
.alert svg { flex-shrink: 0; margin-top: .3rem; }

/* ─── دکمه ─── */
.btn {
  width: 100%; height: 52px;
  border: 0; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: 1rem; font-weight: 800; color: #050a15;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 28px rgba(0,212,255,.32);
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 12px 32px rgba(0,212,255,.45);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.spin {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(5,10,21,.3);
  border-top-color: #050a15;
  border-radius: 50%;
  animation: rot .7s linear infinite;
  display: none;
}
.btn.busy .spin { display: block; }
@keyframes rot { to { transform: rotate(360deg); } }

.foot {
  margin-top: 2rem; font-size: .76rem;
  color: var(--faint); line-height: 1.9;
}

/* ─── ستون تصویری: S-Curve ─── */
.stage {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(2rem, 5vw, 4.5rem);
  background:
    radial-gradient(900px 500px at 70% 10%, rgba(0,212,255,.18), transparent 60%),
    linear-gradient(rgba(45,54,104,.28) 1px, transparent 1px) 0 0/48px 48px,
    linear-gradient(90deg, rgba(45,54,104,.28) 1px, transparent 1px) 0 0/48px 48px,
    transparent;
}
.stage h2 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  font-weight: 800; line-height: 1.5;
  max-width: 24ch; margin-bottom: .8rem;
}
.stage p {
  color: var(--mute); line-height: 2;
  max-width: 46ch; font-size: .95rem; margin-bottom: 2.25rem;
}
.chart {
  width: 100%; max-width: 640px; height: auto;
  direction: ltr; overflow: visible;
}
.legend {
  display: flex; gap: 1.5rem;
  margin-top: 1rem; font-size: .82rem; color: var(--mute);
}
.legend i {
  display: inline-block; width: 22px; height: 3px;
  border-radius: 2px; margin-left: .5rem; vertical-align: middle;
}

/* ─── انیمیشن ترسیم نمودار ─── */
.draw {
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
  animation: draw 2.4s cubic-bezier(.5,0,.2,1) .3s forwards;
}
.draw.b { animation-delay: .9s; }
.status { opacity: 0; animation: fade .6s ease 2.6s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }

/* ─── ریسپانسیو ─── */
@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .stage { display: none; }
  .auth-side { border: 0; min-height: 100vh; }
}

@media (prefers-reduced-motion: reduce) {
  .draw    { animation: none; stroke-dashoffset: 0; }
  .status  { animation: none; opacity: 1; }
  .spin    { animation-duration: 1.6s; }
  .bg-gradient { animation: none; }
}