/* ══════════════════════════════════════════════════════════════
   MINDSUP AI — auth.css
   Brand: Charcoal & Royal Purple
   ══════════════════════════════════════════════════════════════ */
:root {
  --black: #1f271b; 
  --black-mid: #2a332c; 
  --black-light: #3d473f;
  
  --purple: #741054; 
  --purple-light: #9c1b74; 
  --purple-dark: #580c40;
  
  --bg: #151a12; /* زغالی تیره برای پس‌زمینه */
  --tx-1: #fbfffe; 
  --tx-2: #a3aba8; 
  --tx-3: #575e5a;
  
  --bdr: rgba(116, 16, 84, 0.2); 
  --bdr-mid: rgba(116, 16, 84, 0.4);
  
  --sh-sm: 0 2px 8px rgba(0,0,0,.45); 
  --sh-lg: 0 24px 64px rgba(0,0,0,.65); 
  --sh-purple: 0 0 24px rgba(116, 16, 84, 0.3);
  
  --font-body: 'Vazirmatn', sans-serif;
  --font-code: 'JetBrains Mono', monospace;
  
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 24px;
  --t: .25s cubic-bezier(.22,1,.36,1);
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

body {
  font-family: var(--font-body); 
  background: var(--bg); 
  color: var(--tx-1);
  direction: rtl; 
  min-height: 100dvh; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  overflow-y: auto; 
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; background: none; outline: none; }
input { font-family: inherit; }

/* ─── Ambient Orbs ─── */
.ambient { position: fixed; inset: 0; pointer-events: none; z-index: -1; }
.amb-1, .amb-2, .amb-3 { position: absolute; border-radius: 50%; filter: blur(90px); animation: ambDrift 12s ease-in-out infinite; }
.amb-1 { width: 600px; height: 600px; background: radial-gradient(circle, rgba(116,16,84,.4) 0%, transparent 70%); top: -150px; right: -80px; }
.amb-2 { width: 450px; height: 450px; background: radial-gradient(circle, rgba(156,27,116,.2) 0%, transparent 70%); bottom: -80px; left: -60px; animation-delay: -5s; }
.amb-3 { width: 300px; height: 300px; background: radial-gradient(circle, rgba(251,255,254,.08) 0%, transparent 70%); top: 40%; left: 35%; animation-delay: -9s; }
@keyframes ambDrift { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(20px,-18px) scale(1.04)} }

/* ─── Auth Wrapper & Box ─── */
.auth-wrapper {
  width: 100%; max-width: 900px; padding: 20px; z-index: 10;
  display: flex; justify-content: center;
}
.glass-panel {
  display: flex; width: 100%;
  background: rgba(31, 39, 27, 0.4); /* زغالی شیشه‌ای */
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--bdr-mid); border-radius: var(--r-xl);
  box-shadow: var(--sh-lg); overflow: hidden;
}

/* ─── Brand Area ─── */
.auth-brand {
  flex: 1; background: linear-gradient(135deg, rgba(31,39,27,.6), rgba(21,26,18,.9));
  padding: 40px; display: flex; flex-direction: column; justify-content: center;
  border-left: 1px solid var(--bdr);
}
.logo-link { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
/* ─── استایل لوگوی تصویری در صفحه ورود ─── */
.auth-real-logo {
  width: 150px;           /* عرض لوگو */
  height: 150px;          /* ارتفاع لوگو */
  object-fit: contain;   /* جلوگیری از کشیدگی و دفرمه شدن عکس */
  border-radius: 14px;   /* گرد کردن ملایم گوشه‌ها */
  background: var(--white); /* اگر لوگو شفاف (PNG/WebP) است، پس‌زمینه سفید به دیده شدن آن روی رنگ تیره کمک می‌کند */
  box-shadow: 0 0 20px rgba(116, 16, 84, 0.4); /* افکت درخشش (Glow) با رنگ رویال پرپل */
  transition: transform var(--t);
}

.logo-link:hover .auth-real-logo {
  transform: scale(1.05); /* بزرگ‌نمایی ملایم هنگام رفتن موس روی لوگو */
  box-shadow: 0 0 30px rgba(116, 16, 84, 0.6);
}
.logo-text { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 26px; color: var(--tx-1); }
.logo-badge { background: var(--purple); color: var(--tx-1); font-size: 13px; padding: 4px 10px; border-radius: 6px; letter-spacing: 1px; }
.brand-desc { font-size: .95rem; color: var(--tx-2); line-height: 1.8; }

/* ─── Forms Area ─── */
.auth-forms { flex: 1.2; padding: 40px; }
.auth-form { display: none; animation: fadeIn 0.4s cubic-bezier(.22,1,.36,1); }
.auth-form.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-15px); }
  to { opacity: 1; transform: translateX(0); }
}

.auth-form h2 { font-size: 1.6rem; margin-bottom: 8px; color: var(--tx-1); }
.form-sub { font-size: .85rem; color: var(--tx-2); margin-bottom: 24px; }

/* ─── Inputs ─── */
.input-group { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.input-group label { font-size: .8rem; color: var(--tx-2); font-weight: 500; }
.label-row { display: flex; justify-content: space-between; align-items: center; }

.text-btn { color: var(--purple-light); font-weight: 600; transition: color var(--t); font-size: .85rem; }
.text-btn:hover { color: #fff; text-decoration: underline; }
.text-small { font-size: .75rem; }

.input-wrapper { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; right: 14px; color: var(--tx-3); pointer-events: none; }
.input-wrapper input {
  width: 100%; background: rgba(21, 26, 18, 0.6); border: 1px solid var(--bdr-mid);
  border-radius: var(--r-md); padding: 12px 14px 12px 40px; padding-right: 40px;
  color: var(--tx-1); font-size: .9rem; transition: all var(--t); outline: none;
}
.input-wrapper input:focus, .captcha-input:focus {
  border-color: var(--purple-light); box-shadow: 0 0 0 3px rgba(156,27,116,.15), var(--sh-purple);
}
.input-wrapper input::placeholder { color: var(--tx-3); }

.pw-toggle {
  position: absolute; left: 10px; width: 30px; height: 30px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; color: var(--tx-3); transition: var(--t);
}
.pw-toggle:hover { background: rgba(255,255,255,.05); color: var(--purple-light); }

/* ─── Math Captcha ─── */
.captcha-box { display: flex; gap: 10px; align-items: stretch; }
.captcha-eq {
  display: flex; align-items: center; justify-content: center;
  background: rgba(116, 16, 84, 0.15); border: 1px solid var(--bdr-mid);
  border-radius: var(--r-md); padding: 0 16px; font-family: var(--font-code);
  font-weight: 600; font-size: 1rem; color: var(--purple-light); letter-spacing: 2px;
  user-select: none;
}
.captcha-input {
  flex: 1; min-width: 0; background: rgba(21, 26, 18, 0.6); border: 1px solid var(--bdr-mid);
  border-radius: var(--r-md); padding: 12px; color: var(--tx-1); font-size: 1rem;
  text-align: center; transition: all var(--t); outline: none; font-family: var(--font-code);
}
.captcha-input::placeholder { color: var(--tx-3); font-family: var(--font-body); }

/* ─── Button & Spinner ─── */
.btn {
  width: 100%; padding: 12px; border-radius: var(--r-lg); font-size: .95rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px; transition: var(--t);
}
.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  border: 1px solid var(--bdr-mid); color: var(--tx-1); margin-top: 10px;
}
.btn-primary:not(:disabled):hover {
  background: linear-gradient(135deg, var(--purple-light), var(--purple));
  border-color: var(--purple-light); box-shadow: var(--sh-purple); transform: translateY(-2px);
}
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }

.spinner[hidden] { display: none !important; } 
.spinner { animation: rotate 2s linear infinite; width: 22px; height: 22px; }
.spinner .path { stroke: var(--tx-1); stroke-linecap: round; animation: dash 1.5s ease-in-out infinite; }

@keyframes rotate { 100% { transform: rotate(360deg); } }
@keyframes dash {
  0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
  100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

.auth-switch { margin-top: 24px; font-size: .85rem; color: var(--tx-2); text-align: center; }

/* ─── Mobile Bottom Navigation ─── */
.bottom-nav { display: none; }

/* ─── Toasts ─── */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 9999; pointer-events: none; }
.toast { padding: 11px 20px; background: rgba(31,39,27,.97); border: 1px solid var(--bdr-mid); border-radius: var(--r-xl); font-size: .83rem; color: var(--tx-1); box-shadow: var(--sh-sm); white-space: nowrap; animation: toastIn .3s cubic-bezier(.22,1,.36,1); pointer-events: all; backdrop-filter: blur(12px); }
.toast.ok { border-color: rgba(52,211,153,.4); color: #4ade80; }
.toast.err { border-color: rgba(248,113,113,.4); color: #f87171; }
@keyframes toastIn { from{opacity: 0; transform: translateY(10px);} to{opacity: 1; transform: none;} }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  body { align-items: flex-start; }
  .auth-wrapper { padding: 15px; padding-bottom: 90px; } 
  .glass-panel { flex-direction: column; }
  .auth-brand { padding: 30px; border-left: none; border-bottom: 1px solid var(--bdr); align-items: center; text-align: center; }
  .auth-forms { padding: 30px 20px; }
  
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; width: 100%;
    background: rgba(21, 26, 18, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--bdr); z-index: 2000;
    justify-content: space-around; padding: 10px 0;
    padding-bottom: env(safe-area-inset-bottom, 10px);
  }
  .nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    color: var(--tx-3); font-size: .7rem; transition: var(--t);
  }
  .nav-item.active, .nav-item:hover { color: var(--purple-light); }
}

/* 2026 light brand refresh: white, charcoal and royal purple. */
body {
  background: #f3f5f2;
  color: var(--black);
}
.amb-1 { background: radial-gradient(circle, rgba(116,16,84,.15) 0%, transparent 70%); }
.amb-2 { background: radial-gradient(circle, rgba(31,39,27,.08) 0%, transparent 70%); }
.amb-3 { background: radial-gradient(circle, rgba(156,27,116,.08) 0%, transparent 70%); }
.glass-panel {
  background: #fbfffe;
  border-color: #dde2de;
  box-shadow: 0 28px 70px rgba(31,39,27,.14);
}
.auth-brand {
  background: linear-gradient(145deg, #222923, #121612);
  border-left-color: rgba(255,255,255,.08);
}
.auth-forms { background: #fbfffe; }
.auth-form h2 { color: var(--black); }
.form-sub, .input-group label, .auth-switch { color: #68716a; }
.back-link { color: #59615b; }
.back-link:hover, .text-btn { color: var(--purple); }
.text-btn:hover { color: var(--purple-dark); }
.input-wrapper input {
  color: var(--black);
  background: #fff;
  border-color: #dce1dd;
}
.input-wrapper input::placeholder { color: #9aa29c; }
.input-icon { color: #89918b; }
.optional-label { margin-right: 5px; padding: 2px 6px; border-radius: 20px; color: var(--purple); background: rgba(116,16,84,.07); font-size: .65rem; font-weight: 600; }
.auth-real-logo {
  width: 164px;
  height: 164px;
  object-fit: cover;
  border-radius: 28px;
  background: transparent;
  box-shadow: none;
  clip-path: inset(4.5% round 24%);
  transform: scale(1.08);
}
.logo-link:hover .auth-real-logo { transform: scale(1.12); box-shadow: none; }
.btn-submit {
  height: 52px;
  min-height: 52px;
  padding: 0 54px;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.btn-submit .btn-text { display: block !important; min-width: 110px; text-align: center; }
.btn-submit .spinner { position: absolute; left: 18px; width: 20px; height: 20px; }
.btn-submit.is-loading { cursor: wait; opacity: .88; transform: none !important; }
.bottom-nav { background: rgba(24,29,25,.94); }
.toast { background: #202621; color: #fbfffe; }

@media (max-width: 768px) {
  .auth-brand { border-bottom-color: rgba(255,255,255,.08); }
  .auth-real-logo { width: 112px; height: 112px; border-radius: 22px; }
}
