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

:root {
  --color-bg: #f5f6ff;
  --color-surface: rgba(255, 255, 255, 0.88);
  --color-primary: #6366f1;
  --color-primary-strong: #4338ca;
  --color-muted: #6b7280;
  --color-text: #0f172a;
  --color-border: rgba(99, 102, 241, 0.3);
  --color-shadow: rgba(99, 102, 241, 0.2);
  --color-visual: radial-gradient(circle at 25% 20%, rgba(99, 102, 241, 0.75), rgba(15, 23, 42, 0.95));
  --radius-xl: 32px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --transition-base: 0.35s cubic-bezier(0.34, 0.01, 0.21, 1);
}

[data-theme="dark"] {
  --color-bg: #050914;
  --color-surface: rgba(13, 19, 35, 0.92);
  --color-primary: #8b5cf6;
  --color-primary-strong: #c084fc;
  --color-muted: #cbd5f5;
  --color-text: #f8fafc;
  --color-border: rgba(139, 92, 246, 0.35);
  --color-shadow: rgba(0, 0, 0, 0.55);
  --color-visual: radial-gradient(circle at 25% 20%, rgba(139, 92, 246, 0.8), rgba(2, 6, 23, 0.95));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Vazirmatn', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.7;
  transition: background 0.4s ease, color 0.4s ease;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-base);
  font-weight: 600;
}

a:hover {
  color: var(--color-primary-strong);
}

button {
  font-family: inherit;
}

.auth {
  position: relative;
  min-height: 100vh;
  padding: 32px 0 48px;
  display: flex;
  align-items: stretch;
  opacity: 1;
  transform: translateY(18px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.auth--ready {
  opacity: 1;
  transform: translateY(0);
}

.auth__background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.auth__orb {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.45;
  animation: authOrb 16s ease-in-out infinite;
}

.auth__orb--one {
  top: -120px;
  right: -140px;
  background: rgba(99, 102, 241, 0.65);
}

.auth__orb--two {
  bottom: -120px;
  left: -100px;
  background: rgba(59, 130, 246, 0.6);
  animation-delay: 3s;
}

.auth__orb--three {
  bottom: 20%;
  right: 20%;
  background: rgba(244, 114, 182, 0.5);
  animation-delay: 6s;
}

.auth__container {
  position: relative;
  z-index: 1;
  width: 100%;
}

.auth__header {
  margin-bottom: 32px;
}

.auth__brand {
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px var(--color-shadow);
}

[data-theme="dark"] .auth__brand {
  background: rgba(13, 19, 35, 0.8);
}

.auth__brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.auth__brand-text {
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--color-text);
}

.auth__toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 6px 18px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition-base), border var(--transition-base), transform var(--transition-base);
}

[data-theme="dark"] .auth__toggle {
  background: rgba(13, 19, 35, 0.8);
}

.auth__toggle:hover {
  transform: translateY(-2px);
}

.auth__toggle-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #14b8a6);
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.5);
}

.auth__toggle--dark .auth__toggle-dot {
  background: linear-gradient(135deg, #f97316, #f43f5e);
}

.auth__content {
  position: relative;
}

.auth__grid {
  margin: 0;
}

.auth__column {
  display: flex;
}

.auth__panel {
  width: 100%;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: clamp(28px, 4vw, 48px);
  box-shadow: 0 24px 70px var(--color-shadow);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(20px);
  height: 100%;
}

[data-theme="dark"] .auth__panel {
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.auth__panel--visual {
  background: var(--color-visual);
  color: #fff;
  display: flex;
  align-items: center;
}

.auth__heading {
  margin-bottom: 28px;
}

.auth__eyebrow {
  margin: 0 0 10px;
  color: var(--color-primary);
  font-weight: 600;
}

.auth__title {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  color: var(--color-text);
}

.auth__subtitle {
  margin: 0;
  color: var(--color-muted);
}

.auth__form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth__form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: color var(--transition-base);
}

.auth__form-group--active .auth__label {
  color: var(--color-primary);
}

.auth__label {
  font-weight: 600;
  color: var(--color-text);
}

.auth__input {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  padding: 14px 16px;
  font-size: 1rem;
  color: var(--color-text);
  transition: border var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
}

[data-theme="dark"] .auth__input {
  background: rgba(4, 6, 18, 0.7);
}

.auth__input:focus {
  outline: none;
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 20px 35px rgba(99, 102, 241, 0.25);
}

.auth__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.auth__checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}

.auth__checkbox-input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
}

.auth__checkbox-label {
  color: var(--color-text);
}

.auth__button {
  border: none;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  box-shadow: 0 20px 45px rgba(99, 102, 241, 0.45);
}

.auth__button:hover {
  transform: translateY(-3px);
  box-shadow: 0 25px 60px rgba(99, 102, 241, 0.55);
}

.auth__links {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  color: var(--color-muted);
  font-weight: 500;
  flex-wrap: wrap;
}

.auth__link {
  font-weight: 600;
}

.auth__visual {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 40px;
  width: 100%;
  overflow: hidden;
}

.auth__visual-halo {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  top: -80px;
  left: -40px;
  filter: blur(60px);
  animation: authOrb 18s ease-in-out infinite;
}

.auth__visual-core {
  position: relative;
  font-weight: 700;
  letter-spacing: 0.3em;
  font-size: 1.3rem;
  margin-bottom: 16px;
}

.auth__visual-text {
  position: relative;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
}

::placeholder {
  color: var(--color-muted);
}

@media (max-width: 991px) {
  .auth__panel--visual {
    order: -1;
  }
}

@media (max-width: 575px) {
  .auth__panel {
    padding: 24px;
  }
  .auth__actions {
    flex-direction: column;
    align-items: flex-start;
  }
  .auth__toggle-text {
    display: none;
  }
}

@keyframes authOrb {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-18px) scale(1.05);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

/* دیالوگ بدون JS */
.login-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-dialog {
  background: #fff;
  padding: 25px 30px;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
  text-align: center;
  max-width: 400px;
}

.login-dialog h3 {
  margin-bottom: 12px;
  color: #d63638;
  font-size: 1.2rem;
}

.login-dialog p {
  color: #444;
  margin-bottom: 20px;
  line-height: 1.7;
}

.login-dialog-close {
  display: inline-block;
  background: #d63638;
  color: #fff !important;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.25s ease;
}

.login-dialog-close:hover {
  background: #b12a2f;
}
