/* AiMen — ظاهر کامل آموزشک + تم حرفه‌ای آیمن */
:root {
    --indigo: #6d7cff;
    --indigo-dark: #5b6cf0;
    --indigo-soft: rgba(109, 124, 255, 0.16);
    --violet: #9b6dff;
    --bg: #080c14;
    --card: #151d2e;
    --text: #f1f5ff;
    --muted: #9aa3b5;
    --border: rgba(180, 195, 220, 0.28);
    --danger: #ff5c7a;
    --success: #2dd4a0;
    --radius: 18px;
    --input-bg: #1a2336;
    --aside-grad: linear-gradient(155deg, #2f6bff 0%, #5b6cf0 42%, #8b5cf6 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    min-height: 100vh;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    direction: rtl;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
    width: 100%;
}

.az-auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1.1fr;
}

.az-aside {
    background: var(--aside-grad);
    color: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
}

.az-aside::before {
    content: '';
    position: absolute;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    top: -80px; left: -60px;
}
.az-aside::after {
    content: '';
    position: absolute;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    bottom: -40px; right: -30px;
}

.az-aside-inner {
    position: relative;
    z-index: 1;
    max-width: 380px;
}

.az-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--card);
    margin-bottom: 36px;
}
.az-logo-icon {
    width: 42px; height: 42px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px;
    backdrop-filter: blur(4px);
}
.az-logo-text { font-size: 20px; font-weight: 700; letter-spacing: 0.3px; }

.az-aside-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.45;
    margin-bottom: 16px;
}
.az-aside-desc {
    font-size: 14.5px;
    line-height: 1.75;
    opacity: 0.9;
    margin-bottom: 28px;
}
.az-features { list-style: none; }
.az-features li {
    font-size: 14px;
    padding: 8px 0;
    padding-right: 22px;
    position: relative;
    opacity: 0.95;
}
.az-features li::before {
    content: '✓';
    position: absolute;
    right: 0;
    font-weight: 700;
}

.az-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--bg);
}

.az-form-box {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border-radius: 24px;
    padding: 36px 32px;
    box-shadow: 0 12px 40px -12px rgba(79, 70, 229, 0.12);
    border: 1px solid rgba(79, 70, 229, 0.08);
}

.az-switch {
    display: flex;
    background: rgba(255,255,255,0.04);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 28px;
}
.az-switch-btn {
    flex: 1;
    text-align: center;
    padding: 11px 8px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    transition: all 0.2s;
}
.az-switch-btn.active {
    background: var(--card);
    color: var(--indigo);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.az-switch-btn:hover { color: var(--indigo); }

.az-step { display: none; }
.az-step.active { display: block; }

.az-step h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}
.az-hint {
    font-size: 13.5px;
    color: var(--muted);
    margin-bottom: 22px;
    line-height: 1.6;
}

.az-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.az-field { margin-bottom: 16px; }
.az-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
.az-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    background: var(--input-bg);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
/* رمز عبور فقط شامل حروف/اعداد انگلیسی است — همیشه چپ‌چین، در همه مرورگرها */
.az-field input[type="password"] {
    direction: ltr;
    text-align: left;
}
.az-field input:focus {
    border-color: var(--indigo);
    background: var(--card);
    box-shadow: 0 0 0 3px var(--indigo-soft);
}

.err-msg {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
    min-height: 16px;
}

.az-alert {
    display: none;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    margin-bottom: 16px;
    line-height: 1.5;
}
.az-alert.show { display: block; }
.az-alert.error { background: rgba(255,92,122,0.12); color: #ff7a93; border: 1px solid rgba(255,92,122,0.28); }
.az-alert.success { background: rgba(45,212,160,0.12); color: #5eebc0; border: 1px solid rgba(45,212,160,0.28); }
.az-alert.info { background: rgba(109,124,255,0.12); color: var(--indigo-dark); border: 1px solid rgba(109,124,255,0.28); }

.az-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--indigo), var(--violet));
    color: var(--card);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
    transition: transform 0.15s, box-shadow 0.15s;
}
.az-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(79, 70, 229, 0.35);
}
.az-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.az-btn-text {
    width: 100%;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--indigo);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
}
.az-btn-text:hover { text-decoration: none; }

.az-otp {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 18px 0 14px;
}
.az-otp input {
    width: 50px; height: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--input-bg);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.az-otp input:focus {
    border-color: var(--indigo);
    background: var(--card);
    box-shadow: 0 0 0 3px var(--indigo-soft);
}

.az-timer {
    text-align: center;
    font-size: 13.5px;
    color: var(--muted);
    margin-bottom: 14px;
}
.az-timer b { color: var(--indigo); }

.az-back {
    display: block;
    width: 100%;
    margin-top: 18px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--muted);
    cursor: pointer;
    text-align: center;
}
.az-back:hover { color: var(--indigo); }

@media (max-width: 900px) {
    .az-auth { grid-template-columns: 1fr; }
    .az-aside {
        padding: 32px 24px 28px;
        min-height: auto;
    }
    .az-aside-title { font-size: 22px; }
    .az-features { display: none; }
    .az-main { padding: 24px 16px 40px; }
    .az-form-box { padding: 28px 20px; border-radius: 20px; }
    .az-otp input { width: 46px; height: 52px; font-size: 20px; }
}

.az-logo-img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: contain;
    background: rgba(255,255,255,0.2);
    padding: 4px;
}

/* ===== فوق‌العاده ریسپانسیو برای موبایل‌های کوچک ===== */
@media (max-width: 480px) {
    .az-aside { padding: 24px 18px 20px; }
    .az-aside-title { font-size: 19px; }
    .az-main { padding: 18px 12px 32px; }
    .az-form-box { padding: 20px 14px; border-radius: 16px; }
    .az-otp input { width: 38px; height: 46px; font-size: 17px; }
}
@media (max-width: 360px) {
    html, body { font-size: 14.5px; }
    .az-otp { gap: 6px; }
    .az-otp input { width: 32px; height: 42px; font-size: 15px; }
    .az-form-box { padding: 16px 10px; }
}

/* ========== ریسپانسیو حرفه‌ای ورود و ثبت‌نام ========== */
@media (max-width: 900px) {
  .az-auth {
    grid-template-columns: 1fr !important;
    min-height: 100vh;
  }
  .az-aside {
    padding: 28px 20px 22px !important;
    min-height: auto !important;
    border-radius: 0 0 24px 24px;
  }
  .az-aside-inner { max-width: 100%; }
  .az-aside-title {
    font-size: 22px !important;
    line-height: 1.45 !important;
    margin-bottom: 10px !important;
  }
  .az-aside-desc {
    font-size: 13.5px !important;
    line-height: 1.7 !important;
    margin-bottom: 14px !important;
    opacity: 0.95;
  }
  .az-features {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-top: 12px;
  }
  .az-features li {
    font-size: 12px !important;
    padding: 8px 10px !important;
    background: rgba(255,255,255,0.14);
    border-radius: 10px;
    margin: 0 !important;
  }
  .az-features li::before { display: none; }
  .az-main {
    padding: 20px 16px 40px !important;
    align-items: flex-start !important;
  }
  .az-form-box {
    width: 100% !important;
    max-width: 420px;
    margin: 0 auto;
    padding: 24px 18px !important;
    border-radius: 18px !important;
    box-shadow: 0 10px 40px -12px rgba(79,70,229,0.18);
  }
  .az-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .az-field input, .az-field select {
    font-size: 16px !important; /* جلوگیری از زوم iOS */
    min-height: 48px;
  }
  .az-btn {
    min-height: 48px;
    font-size: 15px !important;
    width: 100%;
  }
  .az-otp {
    gap: 8px !important;
    flex-wrap: nowrap !important;
  }
  .az-otp input {
    flex: 1 1 0;
    min-width: 0;
    max-width: 52px;
    height: 52px !important;
    font-size: 20px !important;
  }
}

@media (max-width: 400px) {
  .az-features { grid-template-columns: 1fr !important; }
  .az-aside-title { font-size: 19px !important; }
  .az-form-box { padding: 18px 14px !important; }
  .az-switch-btn { font-size: 13.5px !important; padding: 10px 12px !important; }
  .az-otp input { height: 46px !important; font-size: 18px !important; }
}




/* پذیرش قوانین — ظاهر حرفه‌ای */
.az-terms-field {
  margin: 6px 0 4px;
}
.az-check-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--input-bg) 0%, var(--card) 100%);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
  line-height: 1.65;
  font-size: 13.5px;
  color: #c8d0e0;
  user-select: none;
}
.az-check-label:hover {
  border-color: rgba(125,155,255,0.45);
  background: rgba(109,124,255,0.08);
}
.az-check-label:has(input:checked) {
  border-color: #7c9bff;
  background: rgba(109,124,255,0.12);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.az-check-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  flex-shrink: 0;
  border: 2px solid #94a3b8;
  border-radius: 6px;
  background: var(--card);
  cursor: pointer;
  position: relative;
  transition: all .15s;
}
.az-check-label input[type="checkbox"]:checked {
  border-color: #8da2ff;
  background: #8da2ff;
}
.az-check-label input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.az-check-label input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(125,155,255,0.45);
  outline-offset: 2px;
}
.az-terms-link {
  color: #8da2ff;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(37, 99, 235, 0.35);
  transition: color .15s, border-color .15s;
}
.az-terms-link:hover {
  color: #a8b6ff;
  border-bottom-color: #a8b6ff;
}


/* ===== پذیرش قوانین — نسخه حرفه‌ای نهایی ===== */
.az-terms-field { margin: 10px 0 6px; }
.az-check-label {
  display: flex !important;
  align-items: flex-start !important;
  gap: 14px !important;
  padding: 14px 16px !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 14px !important;
  background: var(--card) !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, background .18s;
  line-height: 1.7 !important;
  font-size: 13.5px !important;
  color: #c8d0e0 !important;
  user-select: none;
}
.az-check-label:hover {
  border-color: #a5b4fc !important;
  background: #fafafe !important;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.08);
}
.az-check-label:has(input:checked) {
  border-color: #6366f1 !important;
  background: linear-gradient(180deg, rgba(109,124,255,0.12) 0%, var(--card) 100%) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14), 0 4px 14px rgba(79, 70, 229, 0.08);
}
.az-check-label input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 22px !important;
  height: 22px !important;
  margin: 2px 0 0 !important;
  flex-shrink: 0 !important;
  border: 2px solid #94a3b8 !important;
  border-radius: 7px !important;
  background: var(--card) !important;
  cursor: pointer;
  position: relative;
  transition: all .15s ease;
}
.az-check-label input[type="checkbox"]:checked {
  border-color: var(--indigo) !important;
  background: linear-gradient(145deg, var(--indigo), #6366f1) !important;
}
.az-check-label input[type="checkbox"]:checked::after {
  content: "" !important;
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.az-terms-link {
  color: var(--indigo) !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  border-bottom: 1.5px solid rgba(79, 70, 229, 0.4) !important;
  padding-bottom: 1px;
  transition: color .15s, border-color .15s;
}
.az-terms-link:hover {
  color: #3730a3 !important;
  border-bottom-color: #3730a3 !important;
}


/* ===== AiMen polish: خوانایی و یکدستی تم ===== */
html, body {
  background: var(--bg) !important;
  color: var(--text) !important;
}
.az-aside,
.az-aside-title,
.az-aside-desc,
.az-features li,
.az-logo-text {
  color: #fff !important;
}
.az-logo-img {
  background: rgba(255,255,255,0.14) !important;
}
.az-form-box {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45) !important;
}
.az-form-box h2 { color: var(--text) !important; }
.az-hint { color: var(--muted) !important; }
.az-hint strong { color: var(--text) !important; }
.az-field label { color: var(--muted) !important; }
.az-field input[type="text"],
.az-field input[type="tel"],
.az-field input[type="password"],
.az-field input[type="number"],
.az-otp-boxes input,
.otp-inputs input {
  background: var(--input-bg) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
.az-field input:focus,
.az-otp-boxes input:focus,
.otp-inputs input:focus {
  border-color: var(--indigo) !important;
  box-shadow: 0 0 0 3px var(--indigo-soft) !important;
}
.az-switch {
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid var(--border) !important;
}
.az-switch-btn { color: var(--muted) !important; }
.az-switch-btn.active {
  color: #fff !important;
  background: linear-gradient(135deg, #3b82f6, #6d7cff 45%, #9b6dff) !important;
  box-shadow: 0 8px 22px rgba(109,124,255,0.35) !important;
}
.az-btn {
  color: #fff !important;
  background: linear-gradient(135deg, #3b82f6, #6d7cff 45%, #9b6dff) !important;
  box-shadow: 0 10px 28px rgba(109,124,255,0.32) !important;
}
.az-btn.secondary,
.az-btn-secondary {
  background: transparent !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}
.az-check-label {
  background: var(--input-bg) !important;
  border-color: var(--border) !important;
  color: #c9d2e3 !important;
}
.az-check-label:hover {
  border-color: rgba(109,124,255,0.5) !important;
  background: rgba(109,124,255,0.08) !important;
}
.az-check-label:has(input:checked) {
  border-color: var(--indigo) !important;
  background: rgba(109,124,255,0.12) !important;
}
.az-check-label input[type="checkbox"] {
  background: #0a0e17 !important;
  border-color: #6b7280 !important;
}
.az-check-label input[type="checkbox"]:checked {
  border-color: var(--indigo) !important;
  background: linear-gradient(145deg, #5b6cf0, #9b6dff) !important;
}
.az-check-label input[type="checkbox"]:checked::after {
  border-color: #fff !important;
}
.az-terms-link { color: #aeb8ff !important; }
.az-resend a, .az-links a, button.link, .az-forgot-link, .az-back {
  color: #aeb8ff !important;
}


/* ===== CONTRAST FIX: ورودی‌ها و OTP کاملاً متمایز از پس‌زمینه ===== */
.az-main { background: #080c14 !important; }
.az-form-box {
  background: #151d2e !important;
  border: 1px solid rgba(190,205,230,0.22) !important;
}
.az-field input[type="text"],
.az-field input[type="tel"],
.az-field input[type="password"],
.az-field input[type="number"],
.az-otp-boxes input,
.otp-inputs input,
input.otp-digit,
.az-form-box input[type="text"],
.az-form-box input[type="tel"],
.az-form-box input[type="password"] {
  background: #243044 !important;
  color: #f8fafc !important;
  border: 1.5px solid rgba(200,215,240,0.38) !important;
  caret-color: #fff !important;
}
.az-field input::placeholder,
.az-form-box input::placeholder {
  color: #9aa6bc !important;
  opacity: 1 !important;
}
.az-field input:focus,
.az-otp-boxes input:focus,
.otp-inputs input:focus,
.az-form-box input:focus {
  background: #2a374f !important;
  border-color: #8b9cff !important;
  box-shadow: 0 0 0 3px rgba(109,124,255,0.28) !important;
  color: #fff !important;
}
.az-otp-boxes input,
.otp-inputs input {
  background: #2a374f !important;
  border: 2px solid rgba(210,220,240,0.45) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
}
.az-check-label {
  background: #1a2336 !important;
  border: 1.5px solid rgba(200,215,240,0.28) !important;
  color: #e2e8f0 !important;
}
.az-check-label input[type="checkbox"] {
  background: #243044 !important;
  border: 2px solid #9aa6bc !important;
}
.az-switch {
  background: #1a2336 !important;
  border: 1px solid rgba(200,215,240,0.22) !important;
}


/* ===== انیمیشن حرفه‌ای پنل معرفی (بدون تغییر رنگ تم) ===== */
.az-aside {
  position: relative !important;
  overflow: hidden !important;
}
.az-aside-inner {
  position: relative !important;
  z-index: 3 !important;
}

/* درخشش نرم چرخشی — بدون تغییر پالت رنگ */
.aimen-aside-shine {
  position: absolute;
  inset: -60%;
  background: conic-gradient(
    from 180deg,
    transparent 0deg,
    rgba(255, 255, 255, 0.10) 50deg,
    transparent 110deg,
    rgba(255, 255, 255, 0.06) 200deg,
    transparent 280deg
  );
  animation: aimenShineSpin 22s linear infinite;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: soft-light;
}

/* دایره‌های نورانی — حرکت نرم و حرفه‌ای */
.aimen-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  will-change: transform, opacity;
}
.aimen-orb-1 {
  width: 300px;
  height: 300px;
  top: -110px;
  left: -90px;
  background: radial-gradient(
    circle at 32% 32%,
    rgba(255, 255, 255, 0.38) 0%,
    rgba(255, 255, 255, 0.12) 42%,
    transparent 70%
  );
  animation: aimenOrbFloatA 11s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}
.aimen-orb-2 {
  width: 260px;
  height: 260px;
  bottom: -90px;
  right: -70px;
  background: radial-gradient(
    circle at 40% 40%,
    rgba(255, 255, 255, 0.30) 0%,
    rgba(255, 255, 255, 0.10) 48%,
    transparent 72%
  );
  animation: aimenOrbFloatB 13s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}
.aimen-orb-3 {
  width: 150px;
  height: 150px;
  top: 48%;
  right: 10%;
  background: radial-gradient(
    circle at 40% 40%,
    rgba(255, 255, 255, 0.28) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 75%
  );
  animation: aimenOrbFloatC 9s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

/* غیرفعال کردن ::before/::after قدیمی تا با orb تداخل نکند */
.az-aside::before,
.az-aside::after {
  content: none !important;
  display: none !important;
}

@keyframes aimenShineSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes aimenOrbFloatA {
  0%   { transform: translate3d(0, 0, 0) scale(1); opacity: 0.75; }
  35%  { transform: translate3d(36px, 28px, 0) scale(1.08); opacity: 1; }
  65%  { transform: translate3d(12px, 52px, 0) scale(0.96); opacity: 0.85; }
  100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.75; }
}
@keyframes aimenOrbFloatB {
  0%   { transform: translate3d(0, 0, 0) scale(1); opacity: 0.7; }
  40%  { transform: translate3d(-40px, -32px, 0) scale(1.1); opacity: 1; }
  70%  { transform: translate3d(-18px, -56px, 0) scale(0.94); opacity: 0.8; }
  100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.7; }
}
@keyframes aimenOrbFloatC {
  0%   { transform: translate3d(0, 0, 0) scale(1); opacity: 0.55; }
  50%  { transform: translate3d(-24px, 30px, 0) scale(1.18); opacity: 0.95; }
  100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
  .aimen-aside-shine,
  .aimen-orb {
    animation: none !important;
  }
}

