/* ==========================================================================
   ios-auth.css — ورود (index.php) و ثبت‌نام (register.php) به سبک iOS
   این دو صفحه استایل مستقل دارند؛ این فایل باید بعد از آن‌ها (قبل از </head>) لود شود.
   ========================================================================== */
:root {
  --bg-deep: #0a0c11; --bg: #0a0c11; --bg-elevated: #14171f;
  --text: #f3f5f9; --text-muted: #8f98aa; --muted: #8f98aa;
  --primary: #2c6df0; --accent: #6aa3ff;
  --danger: #ff453a; --err: #ff453a; --success: #30d158;
  --fill: rgba(255,255,255,0.08); --fill-strong: rgba(255,255,255,0.16);
  --separator: rgba(255,255,255,0.12);
  --glass-border: var(--separator); --border: var(--separator); --input-bg: var(--fill);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "IRANSansWeb", system-ui, Tahoma, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
body.light-theme, body.lt {
  --bg-deep: #f2f4f8; --bg: #f2f4f8; --bg-elevated: #ffffff;
  --text: #11151c; --text-muted: #5d667a; --muted: #5d667a;
  --primary: #0a6cf0; --accent: #0a5fd6;
  --danger: #d70015; --err: #d70015; --success: #248a3d;
  --fill: rgba(60,70,90,0.08); --fill-strong: rgba(60,70,90,0.18);
  --separator: rgba(60,70,90,0.16);
}

/* پس‌زمینه‌ی ساده و بدون درخشش */
html body { background: var(--bg-deep); color: var(--text); font-family: var(--font); }
html body::before { display: none; }
/* باگ قدیمی: overflow:hidden باعث می‌شد با بالا آمدن کیبورد فرم اسکرول نشود */
html body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
html body .card, html body .wrap { max-width: 380px; }

/* لوگو و عنوان */
html body .logo { box-shadow: 0 0 0 0.5px var(--separator); }
html body .card .logo { width: 88px; height: 88px; border-radius: 22px; margin-bottom: 20px; }
html body .hd .logo { width: 40px; height: 40px; border-radius: 10px; }
html body .brand { font-size: 28px; font-weight: 800; letter-spacing: -0.3px; margin-bottom: 6px; }
html body .subtitle { font-size: 15px; margin-bottom: 28px; }
html body .step-title { font-size: 28px; font-weight: 800; letter-spacing: -0.3px; }
html body .step-sub { font-size: 15px; }

/* برچسب‌ها */
html body label, html body .field label {
  font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--text-muted);
  margin: 16px 0 6px; padding-inline: 4px;
}
html body label.remember { margin: 14px 0 0; padding: 0 4px; }

/* فیلدها — ارتفاع ۵۲، فونت ۱۷ (جلوگیری از زوم خودکار iOS)، بدون حاشیه */
html body input[type="text"]:not(.pw),
html body input[type="password"]:not(.pw),
html body .field input:not(.pw) {
  width: 100%; height: 52px; padding: 0 16px; font-size: 17px;
  background: var(--fill); border: 0; border-radius: 12px; color: var(--text);
  box-shadow: inset 0 0 0 0 var(--primary);
  transition: box-shadow 0.18s var(--ease-out), background-color 0.18s ease;
}
html body input[type="text"]:not(.pw):focus,
html body input[type="password"]:not(.pw):focus,
html body .field input:not(.pw):focus {
  background: var(--fill); border: 0; box-shadow: inset 0 0 0 2px var(--primary);
}
html body input::placeholder { color: var(--text-muted); opacity: 0.75; }
html body input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  box-shadow: inset 0 0 0 1000px var(--bg-elevated);
}

/* دکمه‌ها */
html body .btn-primary, html body .btn {
  display: flex; align-items: center; justify-content: center;
  height: 50px; padding: 0; border-radius: 14px; font-size: 17px; font-weight: 600; text-decoration: none;
}
html body .btn-primary { background: var(--primary); color: #fff; border: 0; box-shadow: none; margin-top: 22px; }
html body .btn-primary:hover { opacity: 1; }
html body .btn-primary:active { opacity: 0.85; transform: scale(0.98); }
html body .btn-primary:disabled { opacity: 0.45; }
html body .btn-ghost, html body .register-btn {
  background: var(--fill); border: 0; color: var(--text); margin-top: 10px; box-shadow: none;
}
html body .btn-ghost:hover { background: var(--fill); }
html body .btn-ghost:active { background: var(--fill-strong); }
html body .btn, html body .btn-primary { transition: opacity 0.15s ease, transform 0.12s var(--ease-out), background-color 0.15s ease; }

/* لینک‌های متنی */
html body .toggle-mode, html body .resend-link, html body .hint a { color: var(--accent); font-size: 15px; font-weight: 500; }
body.light-theme .toggle-mode, body.light-theme .resend-link, body.lt .resend-link { color: var(--primary); }
html body .change-phone-link { font-size: 13px; text-decoration: none; }
html body .resend-link:disabled { color: var(--text-muted); }
html body .hint { font-size: 13px; line-height: 1.7; }
html body .divider::before, html body .divider::after { height: 0.5px; background: var(--separator); }

/* خطا */
html body .alert { background: color-mix(in srgb, var(--danger) 12%, transparent); border: 0; border-radius: 12px; color: var(--danger); font-size: 14px; padding: 12px 14px; }
html body .light-theme .alert, body.light-theme .alert { color: var(--danger); }
html body .otp-err, html body .err-msg { font-size: 13px; color: var(--danger); padding-inline: 4px; }
html body .otp-ok { font-size: 13px; color: var(--success); }

/* «من را به خاطر بسپار» = سوییچ iOS */
html body .remember { justify-content: space-between; font-size: 15px; color: var(--text); }
html body .remember input[type="checkbox"] {
  order: 2; -webkit-appearance: none; appearance: none; position: relative; flex-shrink: 0;
  width: 51px; height: 31px; border-radius: 16px; background: var(--fill-strong); cursor: pointer;
  transition: background-color 0.2s ease;
}
html body .remember input[type="checkbox"]::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  transition: transform 0.22s var(--ease-out);
}
html body .remember input[type="checkbox"]:checked { background: #34c759; }
html body .remember input[type="checkbox"]:checked::after { transform: translateX(20px); }

/* دکمه‌ی تم: آیکون SVG به‌جای ایموجی */
html body .theme-btn {
  font-size: 0; width: 38px; height: 38px; background: var(--fill); color: var(--accent);
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  transition: background-color 0.15s ease, transform 0.12s var(--ease-out);
}
body.light-theme .theme-btn, body.lt .theme-btn { color: var(--primary); }
html body .theme-btn::before {
  content: ""; width: 20px; height: 20px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
html body .theme-btn:hover { background: var(--fill); }
html body .theme-btn:active { background: var(--fill-strong); transform: scale(0.92); }

/* نشانگر مراحل ثبت‌نام = Page Control */
html body .dots { gap: 8px; margin-bottom: 26px; }
html body .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--fill-strong); transition: background-color 0.2s ease; }
html body .dot.active { width: 7px; background: var(--primary); border-radius: 50%; }
html body .dot.done { background: var(--primary); opacity: 0.45; }

/* حرکت */
@media (prefers-reduced-motion: reduce) {
  html body .card, html body .wrap, html body .step.on, html body .auth-view, html body .auth-view.leaving { animation: none; }
  html body .remember input[type="checkbox"]::after { transition: none; }
  html body .btn:active, html body .btn-primary:active, html body .theme-btn:active { transform: none; }
}

/* bind_phone.php (تایید شماره برای کاربران قدیمی) */
html body .title { font-size: 28px; font-weight: 800; letter-spacing: -0.3px; }
html body .sub { font-size: 15px; color: var(--text-muted); line-height: 1.7; }
html body .change-link { color: var(--text-muted); font-size: 13px; text-decoration: none; }

/* لوگوی ثبت‌نام: بدون بک‌گراند در تم تیره؛ در تم روشن نسخه‌ی با بک‌گراند (نشان سفید روی زمینه‌ی روشن دیده نمی‌شود) */
html body .hd .logo-nobg { width: 44px; height: 44px; border-radius: 0; box-shadow: none; object-fit: contain; }
html body .hd .logo-bg { display: none; }
html body.lt .hd .logo-nobg { display: none; }
html body.lt .hd .logo-bg { display: block; }
