@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

:root {
  --auth-bg: #05060c;
  --auth-blue: #4C7DFF;
  --auth-purple: #9B7BFF;
  --auth-text: #F3F5FF;
  --auth-muted: #9AA3C7;
  --auth-border: rgba(140, 170, 255, .16);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.auth-page {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--auth-bg);
  color: var(--auth-text);
  min-height: 100vh;
  overflow-x: hidden;
}

button { font-family: inherit; }
*:focus-visible { outline: 2px solid #6E93FF; outline-offset: 2px; }

.auth-shell { position: relative; min-height: 100vh; }

/* ---------------- صحنه سینمایی (تمام‌صفحه، پشت فرم هم ادامه دارد) ---------------- */
.auth-scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #05060c;
  z-index: 0;
}
.auth-scene-bg-zoom {
  position: absolute; inset: 0; overflow: hidden;
  animation: scene-zoom 26s ease-in-out infinite alternate;
}
.auth-scene-bg {
  position: absolute; inset: -4%;
  background: url('login-scene.jpg') center / cover no-repeat;
  transition: transform .4s ease-out;
}
@keyframes scene-zoom { from { transform: scale(1); } to { transform: scale(1.06); } }

.auth-scene-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to left, rgba(2,3,10,.65) 0%, rgba(2,3,10,.25) 32%, transparent 55%),
    radial-gradient(ellipse at 50% 45%, transparent 38%, rgba(2,3,8,.5) 100%),
    linear-gradient(180deg, rgba(2,3,10,.15) 0%, rgba(2,3,10,.2) 60%, rgba(2,3,10,.7) 100%);
}

.auth-scene-glow {
  position: absolute; border-radius: 50%; filter: blur(70px);
  opacity: .3; pointer-events: none; mix-blend-mode: screen;
}
.auth-scene-glow-a {
  width: 380px; height: 380px; background: #3D6BFF;
  top: 28%; left: 26%; animation: glow-pulse 6s ease-in-out infinite;
}
.auth-scene-glow-b {
  width: 300px; height: 300px; background: #8B5CFF;
  top: 46%; left: 54%; animation: glow-pulse 7s ease-in-out infinite 1.4s;
}
@keyframes glow-pulse {
  0%, 100% { opacity: .22; transform: scale(1); }
  50% { opacity: .45; transform: scale(1.15); }
}

.auth-scene-brand {
  position: absolute; top: 28px; left: 36px;
  display: flex; align-items: center; gap: 10px; z-index: 2;
  animation: fade-down .8s ease both;
}
.auth-logo-mark { width: 30px; height: 30px; flex-shrink: 0; }
.auth-logo-text { color: #EDEFFC; font-size: 14px; font-weight: 600; letter-spacing: .2px; }

.auth-scene-tagline {
  position: absolute; bottom: 28px; left: 36px;
  display: flex; align-items: center; gap: 12px;
  color: rgba(230,233,255,.6); font-size: 12px; letter-spacing: .5px; z-index: 2;
  animation: fade-up .9s ease .2s both;
}
.auth-scene-tagline i { width: 14px; height: 1px; background: rgba(230,233,255,.4); display: inline-block; }

/* ---------------- پنل فرم ---------------- */
.auth-panel {
  position: relative; z-index: 1; min-height: 100vh;
  display: flex; align-items: center; justify-content: flex-start;
  padding: 40px 64px;
}

.auth-card {
  width: 100%; max-width: 380px;
  background: linear-gradient(180deg, rgba(22,26,46,.6), rgba(10,12,22,.78));
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--auth-border);
  border-radius: 22px;
  padding: 34px 30px;
  box-shadow: 0 30px 80px rgba(2,4,16,.55), 0 0 60px rgba(76,109,255,.08), inset 0 0 0 1px rgba(255,255,255,.02);
  animation: card-in .7s cubic-bezier(.19,1,.22,1) both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.auth-card-logo { width: 44px; height: 44px; margin: 0 auto 18px; animation: fade-down .6s ease .1s both; }
.auth-card-logo svg { width: 100%; height: 100%; }

.auth-title { color: var(--auth-text); font-size: 19px; font-weight: 800; text-align: center; margin: 0 0 6px; animation: fade-up .6s ease .15s both; }
.auth-sub { color: var(--auth-muted); font-size: 12.5px; text-align: center; margin: 0 0 22px; animation: fade-up .6s ease .2s both; }

.auth-alert {
  background: rgba(230,70,70,.12); border: 1px solid rgba(230,70,70,.35);
  color: #FF9D9D; font-size: 12.5px; padding: 9px 12px; border-radius: 10px;
  margin-bottom: 14px; animation: alert-shake .4s ease;
}
@keyframes alert-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.auth-field { display: block; margin-bottom: 14px; animation: fade-up .6s ease .25s both; }
.auth-field-label { display: block; font-size: 11.5px; color: var(--auth-muted); margin-bottom: 6px; font-weight: 600; }
.auth-input {
  width: 100%; background: rgba(255,255,255,.03); border: 1px solid var(--auth-border);
  color: var(--auth-text); border-radius: 12px; padding: 11px 14px; font-size: 13.5px;
  font-family: inherit; transition: border-color .2s, box-shadow .2s, background .2s;
}
.auth-input::placeholder { color: #5B6388; }
.auth-input:focus { outline: none; border-color: #6E93FF; box-shadow: 0 0 0 3px rgba(76,125,255,.18); background: rgba(255,255,255,.05); }
.auth-input.has-error { border-color: rgba(230,70,70,.6); }
.auth-field-error { display: block; min-height: 14px; font-size: 11px; color: #FF8A8A; margin-top: 5px; }

.auth-password-wrap { position: relative; }
.auth-password-wrap .auth-input { padding-left: 40px; }
.auth-eye-btn {
  position: absolute; top: 50%; left: 10px; transform: translateY(-50%);
  background: none; border: none; color: #7B84AC; cursor: pointer; padding: 4px; display: flex;
}
.auth-eye-btn:hover { color: #C9D0FF; }
.auth-eye-btn svg { width: 18px; height: 18px; }

.auth-row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; animation: fade-up .6s ease .3s both; }
.auth-remember { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #AEB4D6; cursor: pointer; }
.auth-remember input { width: 15px; height: 15px; accent-color: var(--auth-blue); cursor: pointer; }
.auth-link-btn { background: none; border: none; color: #8FA6FF; font-size: 12px; cursor: pointer; font-family: inherit; padding: 0; }
.auth-link-btn:hover { color: #C2D0FF; text-decoration: underline; }
.auth-hint {
  font-size: 11.5px; color: #8089AD; background: rgba(255,255,255,.03);
  border: 1px solid rgba(140,170,255,.12); border-radius: 9px; padding: 8px 10px; margin: 8px 0 0;
}

.auth-submit {
  width: 100%; margin-top: 18px;
  background: linear-gradient(135deg, var(--auth-blue), var(--auth-purple));
  color: #fff; border: none; border-radius: 13px; padding: 12px; font-size: 14px; font-weight: 700;
  cursor: pointer; position: relative; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: filter .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 10px 30px rgba(76,109,255,.3);
  animation: fade-up .6s ease .35s both;
}
.auth-submit:hover { filter: brightness(1.08); box-shadow: 0 14px 36px rgba(76,109,255,.4); }
.auth-submit:active { transform: scale(.98); }
.auth-submit:disabled { opacity: .75; cursor: default; }
.auth-submit-spinner {
  width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; display: none; animation: spin .7s linear infinite;
}
.auth-submit.is-loading .auth-submit-label { opacity: .75; }
.auth-submit.is-loading .auth-submit-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: #5B6388; font-size: 11.5px; animation: fade-up .6s ease .4s both; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: rgba(140,170,255,.14); }

.auth-google-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(255,255,255,.04); border: 1px solid var(--auth-border); color: #E3E6FA;
  border-radius: 13px; padding: 10px; font-size: 13px; cursor: pointer;
  transition: background .2s, border-color .2s; animation: fade-up .6s ease .45s both;
}
.auth-google-btn:hover { background: rgba(255,255,255,.07); border-color: rgba(140,170,255,.3); }
.auth-google-note { text-align: center; font-size: 11px; color: #7B84AC; margin: 8px 0 0; }

.auth-footer-note { text-align: center; font-size: 12px; color: #8089AD; margin: 20px 0 0; animation: fade-up .6s ease .5s both; }

@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------- ریسپانسیو ---------------- */
@media (max-width: 980px) {
  .auth-scene { display: none; }
  .auth-panel {
    min-height: 100vh; padding: 28px 18px; justify-content: center;
    background: radial-gradient(ellipse at 50% 0%, rgba(76,109,255,.14), transparent 55%), var(--auth-bg);
  }
}
@media (max-width: 420px) {
  .auth-card { padding: 26px 20px; border-radius: 18px; }
}

/* ---------------- کاهش انیمیشن ---------------- */
@media (prefers-reduced-motion: reduce) {
  .auth-scene-bg-zoom, .auth-scene-glow, .auth-card, .auth-field, .auth-row-between,
  .auth-submit, .auth-divider, .auth-google-btn, .auth-footer-note, .auth-card-logo,
  .auth-title, .auth-sub, .auth-scene-brand, .auth-scene-tagline, .auth-alert {
    animation: none !important;
  }
  .auth-scene-bg { transition: none !important; }
}
