/* ===== AMIR CHAT — Login / Register — Luxury Dark Glassmorphism =====
   هم‌خانواده‌ی بصری با AMIR PANEL: پس‌زمینه‌ی مش متحرک، شیشه‌ای تیره، نئون آبی/فیروزه‌ای */

.amir-zero-luxury {
  --c-primary: #00d4ff;
  --c-secondary: #4a6cff;
  --c-bg: #05070c;
  --c-bg-2: #0a0d14;
  --c-glass: rgba(255, 255, 255, 0.06);
  --c-glass-border: rgba(255, 255, 255, 0.12);
  --c-text: #ffffff;
  --c-text-soft: rgba(255, 255, 255, 0.62);
  --c-danger: #ff5470;

  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  background: radial-gradient(circle at 50% 0%, #0c1626 0%, var(--c-bg) 55%);
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--c-text);
  font-family: "Vazirmatn", "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
}

.amir-zero-luxury * { box-sizing: border-box; }

.amir-mesh-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

.amir-zero-card-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

/* ===== برند ===== */
.amir-zero-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.amir-zero-brand-badge {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-primary);
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.16), rgba(74, 108, 255, 0.16));
  border: 1px solid var(--c-glass-border);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.25);
  overflow: hidden;
}
.amir-zero-brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.amir-zero-brand-text { display: flex; flex-direction: column; }
.amir-zero-brand-name {
  font-family: "Space Grotesk", "Vazirmatn", sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.amir-zero-brand-slogan { font-size: 12.5px; color: var(--c-text-soft); }

/* ===== کارت شیشه‌ای ===== */
.amir-zero-card {
  width: 100%;
  background: var(--c-glass);
  border: 1px solid var(--c-glass-border);
  border-radius: 24px;
  padding: 30px 26px 26px;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
}
.amir-zero-card::before {
  content: "";
  position: absolute;
  top: -60%;
  inset-inline-start: -20%;
  width: 140%;
  height: 140%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.12), transparent 60%);
  pointer-events: none;
}

/* ===== تب‌های ورود/ثبت‌نام ===== */
.amir-auth-tabs {
  position: relative;
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--c-glass-border);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 22px;
}
.amir-auth-tabs-sub { margin-bottom: 18px; }
.amir-auth-tab {
  flex: 1;
  position: relative;
  z-index: 1;
  background: transparent;
  border: none;
  color: var(--c-text-soft);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 6px;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.25s ease;
}
.amir-auth-tab-active { color: #071019; }
/* توجه: چون کل رابط کاربری راست‌به‌چپ (RTL) است، از مقادیر فیزیکی (right/translateX) به‌جای
   خاصیت‌های منطقی استفاده می‌شود؛ چون transform هیچ‌وقت تحت‌تأثیر dir قرار نمی‌گیرد و ترکیب
   inset-inline-start با یک override جهت‌دار باعث می‌شد نشانگر کاملاً از کادر بیرون بزند (باگ قبلی). */
.amir-auth-tab-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  right: 4px;
  width: calc(50% - 4px);
  background: linear-gradient(135deg, var(--c-primary), var(--c-secondary));
  border-radius: 10px;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 4px 18px rgba(0, 212, 255, 0.35);
}
.amir-auth-tabs[data-active="register"] .amir-auth-tab-indicator,
.amir-auth-tabs[data-active="mobile"] .amir-auth-tab-indicator {
  transform: translateX(-100%);
}

/* ===== مراحل فرم ===== */
.amir-otp-step { display: none; animation: amirFadeUp 0.35s ease; }
.amir-otp-step-active { display: block; }
@keyframes amirFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.amir-otp-icon { display: flex; justify-content: center; margin-bottom: 10px; color: var(--c-primary); filter: drop-shadow(0 0 14px rgba(0, 212, 255, 0.45)); }
.amir-otp-title { text-align: center; font-size: 19px; font-weight: 700; margin: 0 0 6px; }
.amir-otp-subtitle { text-align: center; font-size: 13px; color: var(--c-text-soft); margin: 0 0 22px; line-height: 1.8; }

/* ===== فیلدها ===== */
.amir-neon-field { margin-bottom: 14px; }

/* حاشیه‌ی گرادینت ۶ رنگ متحرک دور فیلدها هنگام فوکوس — عیناً همان تکنیک AMIR PANEL:
   چرخش واقعی زاویه‌ی conic-gradient با @property (بدون لایه‌ی اضافه). رنگ‌ها و سرعت از
   طریق متغیرهای --fg1..--fg6 و --fg-speed که از پنل تنظیمات افزونه تزریق می‌شوند قابل تغییرند. */
@property --amir-border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes amirBorderSpin { to { --amir-border-angle: 360deg; } }

.amir-gradient-border {
  --amir-border-angle: 0deg;
  position: relative;
  padding: 1px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.15s;
}
.amir-gradient-border.amir-gradient-active {
  padding: 2px;
  will-change: background;
  background: conic-gradient(from var(--amir-border-angle),
    var(--fg1, #00d4ff), var(--fg2, #00ff96), var(--fg3, #4a6cff),
    var(--fg4, #a855f7), var(--fg5, #ff2fb0), var(--fg6, #ffd166), var(--fg1, #00d4ff));
  animation-name: amirBorderSpin;
  animation-duration: var(--fg-speed, 4s);
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.amir-gradient-border-inner {
  position: relative;
  z-index: 1;
  background: var(--c-bg-2);
  border-radius: 13px;
  display: flex;
  align-items: center;
}
.amir-gradient-border-inner input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--c-text);
  font-family: inherit;
  font-size: 14.5px;
  padding: 14px 16px;
}
.amir-gradient-border-inner input::placeholder { color: rgba(255, 255, 255, 0.32); }

@media (prefers-reduced-motion: reduce) {
  .amir-gradient-border.amir-gradient-active { animation: none; --amir-border-angle: 45deg; }
}

/* فیلد به‌همراه دکمه‌ی کوچک کنار آن (مثل «دریافت کد») — ساختار:
   div.amir-otp-field-with-btn > div.amir-gradient-border(flex:1) + button.amir-otp-mini-btn */
.amir-otp-field-with-btn { display: flex; align-items: stretch; gap: 8px; margin-bottom: 14px; }
.amir-otp-field-with-btn .amir-gradient-border { flex: 1; margin-bottom: 0; }
.amir-otp-mini-btn {
  flex-shrink: 0;
  white-space: nowrap;
  border: 1px solid var(--c-glass-border);
  background: rgba(255,255,255,0.06);
  color: var(--c-primary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 12px;
  padding: 0 14px;
  cursor: pointer;
  transition: background .2s ease, opacity .2s ease;
}
.amir-otp-mini-btn:hover { background: rgba(0,212,255,.14); }
.amir-otp-mini-btn:disabled { opacity: .55; cursor: not-allowed; }

.amir-otp-hint {
  font-size: 11.5px;
  color: var(--c-text-soft);
  text-align: center;
  margin: 2px 0 12px;
  min-height: 14px;
}

.amir-link-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--c-primary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  padding: 4px 0 16px;
}
.amir-link-btn:hover { text-decoration: underline; }

.amir-otp-error {
  min-height: 18px;
  color: var(--c-danger);
  font-size: 12.5px;
  text-align: center;
  margin-bottom: 8px;
}

/* ===== دکمه‌ها ===== */
.amir-otp-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.25s ease;
}
.amir-magnetic-btn {
  color: #071019;
  background: linear-gradient(135deg, var(--c-primary), var(--c-secondary));
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.28);
}
.amir-magnetic-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(0, 212, 255, 0.38); }
.amir-magnetic-btn:active { transform: translateY(0); }
.amir-otp-btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

.amir-otp-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(7, 16, 25, 0.35);
  border-top-color: #071019;
  animation: amirSpin 0.7s linear infinite;
}
.amir-otp-btn.is-loading .amir-otp-btn-text { opacity: 0.001; position: absolute; }
.amir-otp-btn.is-loading .amir-otp-spinner { display: inline-block; }
@keyframes amirSpin { to { transform: rotate(360deg); } }

.amir-divider {
  text-align: center;
  color: var(--c-text-soft);
  font-size: 12px;
  margin: 18px 0;
  position: relative;
}
.amir-divider::before, .amir-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: var(--c-glass-border);
}
.amir-divider::before { inset-inline-start: 0; }
.amir-divider::after { inset-inline-end: 0; }

.amir-zero-footer-note {
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.68);
  text-align: center;
}

@media (max-width: 420px) {
  .amir-zero-card { padding: 24px 18px 20px; border-radius: 20px; }
}
