/* صفحه ورود v3 — صحنهٔ تمام‌صفحهٔ واحد + محتوای دو ستونه روی آن
   (برند راست، فرم چپ؛ حداکثر عرض ۱۳۰۰px وسط‌چین) */

.login-page, .login-page input {
  color-scheme: dark;
}
.login-page {
  --bg: #1b1d28;
  --surface: rgba(52, 54, 70, 0.62);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f2f4fa;
  --muted: #8f94ad;
  --accent: #1fcc94;
  --accent-2: #5b8def;
  --gold: #DEBE69;
  --danger: #ff5d6c;
  --accent-text: #5ff0b8;
  --field-bg: #0b111b;
  --field-border: rgba(255, 255, 255, 0.08);
  --field-h: 54px;
  color-scheme: dark;
}

/* ============ صحنهٔ تمام‌صفحه (یک لایه، بدون لبه) ============ */
.login-stage {
  position: fixed;
  inset: 0;
  min-height: 100dvh;
  background:
    radial-gradient(1000px 600px at 74% 18%, rgba(31, 204, 148, 0.14), transparent 62%),
    radial-gradient(800px 520px at 18% 82%, rgba(91, 141, 239, 0.09), transparent 62%),
    linear-gradient(165deg, #23252f 0%, var(--bg) 60%, #14161f 100%);
  overflow: hidden;
  pointer-events: none;
}
/* گرید نقطه‌ای با ماسک شعاعی */
.login-stage .dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.09) 1px, transparent 1.4px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(760px 620px at 70% 38%, #000 25%, transparent 75%);
  mask-image: radial-gradient(760px 620px at 70% 38%, #000 25%, transparent 75%);
}
/* نویز ظریف */
.login-stage .noise {
  position: absolute; inset: 0; opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='.6'/></svg>");
}
/* هاله‌های نور سبز + کمی طلایی */
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px);
  animation: orb-drift 18s ease-in-out infinite alternate;
}
.orb-1 { width: 460px; height: 460px; background: rgba(31, 204, 148, 0.14); top: -10%; right: -4%; }
.orb-2 { width: 360px; height: 360px; background: rgba(91, 141, 239, 0.09); bottom: -12%; right: 34%; animation-delay: -6s; }
.orb-3 { width: 300px; height: 300px; background: rgba(222, 190, 105, 0.07); top: 42%; right: 62%; animation-delay: -12s; }
@keyframes orb-drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-50px, 34px) scale(1.14); }
}
/* نمودار ناحیه‌ای تمام‌عرض در یک‌سوم پایین */
.stage-chart {
  position: absolute; left: 0; right: 0; bottom: 0;
  width: 100%; height: 38vh; min-height: 220px;
  display: block;
}
.stage-chart .draw {
  stroke-dasharray: 2200; stroke-dashoffset: 2200;
  animation: draw-line 2.4s ease-out .4s forwards;
  filter: drop-shadow(0 4px 16px rgba(31, 204, 148, 0.5));
}
@keyframes draw-line { to { stroke-dashoffset: 0; } }
/* کندل‌های شیشه‌ای: شناوری ملایم بالا/پایین */
.candle, .vol {
  transform-box: fill-box;
  transform-origin: center;
  animation: candleWave 7s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.9s);   /* اختلاف فاز = حس موج */
  will-change: transform;
}
.vol { animation-name: volWave; }
@keyframes candleWave {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
@keyframes volWave {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
.stage-chart .traveler { animation: none; }
/* نقطهٔ درخشان متحرک روی خط */
.glow-dot { filter: drop-shadow(0 0 6px rgba(31,204,148,.9)); }

@keyframes rise-in { from { opacity: 0; transform: translateY(16px); } }
@keyframes shake {
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}

/* ============ محتوای دو ستونه روی صحنه ============ */
.login-content {
  position: relative; z-index: 2;
  min-height: 100dvh;
  max-width: 1300px;
  margin-inline: auto;
  padding: 40px;
  display: grid;
  grid-template-columns: 3fr 2fr;
  align-items: center;
  gap: 28px;
}

/* ---- ستون برند (راست) ---- */
.brand-col { position: relative; top: -38px; animation: rise-in .6s cubic-bezier(.2,.8,.2,1) both; }  /* ۱cm بالاتر تا با نمودار پایین هم‌پوشانی نکند */
.brand-mark {
  width: 76px; height: 76px; border-radius: 20px; object-fit: cover;
  box-shadow: 0 16px 38px rgba(0,0,0,.5), 0 0 0 1px var(--border);
  margin-bottom: 28px;
  animation: logoFloat 7s ease-in-out infinite;  /* همان شناوری ملایم کندل‌ها */
  will-change: transform;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
.brand-title {
  font-size: clamp(2.4rem, 4vw, 4rem);
  font-weight: 800; line-height: 1.55; margin: 0 0 22px;
  color: var(--text);
}
.brand-title b { color: var(--accent); font-weight: 800; }
.brand-sub { color: var(--muted); font-size: 14px; margin: 0 0 26px; }
.brand-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(52, 54, 70, 0.55);
  border: 1px solid var(--border);
  font-size: 13px; color: var(--text);
}
.chip svg {
  width: 15px; height: 15px; fill: none; stroke: var(--accent);
  stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round;
}

/* ---- ستون فرم (چپ) ---- */
.form-col { display: flex; justify-content: center; }
.login-card {
  position: relative;
  width: clamp(400px, 34vw, 480px);
  background: var(--surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.06);
  padding: 40px 36px 22px;
  animation: rise-in .55s cubic-bezier(.2,.8,.2,1) .1s both;
}
.login-card.shake { animation: rise-in .55s cubic-bezier(.2,.8,.2,1) .1s both, shake .4s ease .15s; }
.login-card::before {
  content: ""; position: absolute; top: 0; left: 24px; right: 24px; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--gold), transparent);
  opacity: .8;
}

.card-head { text-align: center; margin-bottom: 24px; }
.card-head h1 { font-size: 26px; font-weight: 700; margin: 0; }
.card-head .sub { color: #aab0c4; font-size: 13.5px; margin: 6px 0 0; }

.login-error {
  display: flex; align-items: center; gap: 8px; text-align: right;
  background: rgba(255, 93, 108, 0.10);
  border: 1px solid rgba(255, 93, 108, 0.35);
  color: var(--danger);
  border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 16px;
}
.login-error .ico { flex: none; font-weight: 700; }

.field-group { margin-bottom: 16px; }
.field-group label {
  display: block; font-size: 14px; color: var(--text);
  margin-bottom: 7px; font-weight: 600;
}
.field { position: relative; }
.field input {
  width: 100%;
  height: var(--field-h);
  box-sizing: border-box;
  padding: 0 46px;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 14px;
  font-family: inherit; font-size: 15.5px; color: var(--accent-text);
  caret-color: var(--accent-text);
  font-variant-numeric: tabular-nums;
  line-height: 54px;
  padding-block: 0;
  outline: none;
  direction: ltr;
  text-align: left;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(52, 224, 161, 0.18);
}
.field input:hover { border-color: rgba(255, 255, 255, 0.16); }
#password-input { letter-spacing: 2px; }
#password-input::placeholder { letter-spacing: normal; }
.field input::placeholder { color: rgba(143, 148, 173, 0.78); }
.field .icon-start, .field .icon-end {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; pointer-events: none;
}
.field .icon-start {
  right: 14px;
  fill: none; stroke: var(--muted); stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
  transition: stroke .2s;
}
.field input:focus ~ .icon-start { stroke: var(--accent); }
.field .icon-end {
  left: 14px; pointer-events: auto;
  width: 32px; height: 32px;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); cursor: pointer;
  display: grid; place-items: center;
}
.field .icon-end:hover { color: var(--text); background: rgba(255,255,255,.06); }
.field .icon-end svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}

/* override کامل autofill — تنها جای مجاز !important */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--field-bg) inset !important;
  box-shadow: 0 0 0 1000px var(--field-bg) inset !important;
  -webkit-text-fill-color: var(--accent-text) !important;
  caret-color: var(--accent-text);
  border-radius: inherit;
  transition: background-color 99999s ease-in-out 0s;
}
input:autofill {
  background: var(--field-bg);
  color: var(--accent-text);
  caret-color: var(--accent-text);
}

/* هشدار Caps Lock */
.caps-hint {
  display: none; align-items: center; gap: 7px;
  margin-top: 7px; font-size: 12px; color: var(--gold);
}
.caps-hint.show { display: flex; }
.caps-hint svg {
  width: 14px; height: 14px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.login-submit {
  width: 100%; margin-top: 8px; height: var(--field-h);
  border: 0; border-radius: 13px; cursor: pointer;
  font: 700 15px Vazirmatn, Tahoma, sans-serif; color: #06251c;
  background: linear-gradient(135deg, #2ee6ab, var(--accent) 55%, #0f9a6d);
  box-shadow: 0 10px 24px rgba(31, 204, 148, 0.26);
  display: flex; align-items: center; justify-content: center; gap: 9px;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.login-submit:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 14px 30px rgba(31,204,148,.32); }
.login-submit:active { transform: translateY(0) scale(.995); }
.login-submit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.login-submit .spinner {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid rgba(6, 37, 28, 0.25); border-top-color: #06251c;
  animation: spin .7s linear infinite; display: none;
}
.login-submit.loading .spinner { display: inline-block; }
.login-submit.loading { pointer-events: none; opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-foot {
  margin-top: 20px; padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px; color: var(--muted); text-align: center;
}

/* ============ ریسپانسیو ============ */
@media (max-width: 480px) {
  .login-card { width: 100%; }  /* clamp(400px,…) در عرض ۳۶۰ سرریز می‌داد */
}
@media (max-width: 900px) {
  .login-content { grid-template-columns: 1fr; padding: 30px 20px 46px; gap: 24px; align-items: start; }
  .brand-col { text-align: center; padding-top: 4vh; }
  .brand-gold-rule, .brand-mark { margin-inline: auto; }
  .brand-chips { justify-content: center; }
  .brand-title { font-size: clamp(2rem, 8vw, 2.6rem); }
  .form-col { align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .orb, .brand-col, .brand-mark, .login-card, .login-stage .draw,
  .login-submit .spinner, .stage-chart g.candle, .stage-chart g.vol { animation: none !important; }
  .login-stage .draw { stroke-dashoffset: 0; }
  .login-submit:hover, .login-submit:active { transform: none; }
}
