/* login-upgrade-v1 — صفحهٔ ورود (OTP): کارت شیشه‌ای، نوار دو مرحله‌ای، ورودی واحد کد، ستون «چرا کارمت» در دسکتاپ */
.page {
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 480px at 15% -10%, rgba(229, 170, 23, 0.24), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(255, 255, 255, 0.68), transparent 55%),
    radial-gradient(900px 520px at -10% 100%, rgba(247, 205, 79, 0.22), transparent 60%),
    linear-gradient(180deg, var(--color-surface-base) 0%, var(--color-neutral-100) 100%);
}
.page::before {
  content: "";
  position: absolute;
  inset: -10% -5% auto -5%;
  height: 60%;
  pointer-events: none;
  background:
    radial-gradient(220px 220px at 20% 40%, rgba(255, 255, 255, 0.74), transparent 70%),
    radial-gradient(260px 260px at 80% 20%, rgba(229, 170, 23, 0.18), transparent 70%);
  filter: blur(6px);
  opacity: 0.82;
  animation: pageGlowDrift 18s ease-in-out infinite;
}
.page::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(42, 38, 33, 0.08) 1px, transparent 0);
  background-size: 3px 3px;
  opacity: 0.045;
  animation: pageGlowPulse 22s ease-in-out infinite;
}
@keyframes pageGlowDrift {
  0%, 100% { transform: translate3d(-1%, -1%, 0) scale(1); opacity: 0.75; }
  50% { transform: translate3d(2%, 1%, 0) scale(1.03); opacity: 0.9; }
}
@keyframes pageGlowPulse {
  0%, 100% { opacity: 0.04; }
  50% { opacity: 0.085; }
}

.page .container {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 28px);
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin-inline: auto;
}
.page .container > .auth { width: 100%; }

/* ---------- قاب ---------- */
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 28px;
  width: 100%;
}
.auth-main { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; }
.auth-aside { display: none; }

.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand img { width: 44px; height: 44px; border-radius: 13px; box-shadow: 0 6px 16px rgba(42, 38, 33, 0.14); }
.auth-brand__name { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.2px; color: var(--text-main); }

.auth-header { display: flex; flex-direction: column; gap: 8px; }
.auth-title { margin: 0; font-size: clamp(1.45rem, 5.6vw, 1.85rem); line-height: 1.45; font-weight: 800; letter-spacing: -0.4px; color: var(--text-main); }
.auth-sub { margin: 0; font-size: 0.9rem; line-height: 1.9; color: var(--text-muted); }

/* ---------- کارت ---------- */
.auth-card {
  position: relative;
  padding: 18px 18px 16px;
  border-radius: 26px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-3), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* نوار دو مرحله‌ای */
.auth-progress { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 10px; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); }
.auth-progress li:not(.auth-progress__bar) { display: inline-flex; align-items: center; gap: 6px; opacity: 0.55; transition: opacity 0.2s ease; }
.auth-progress li.is-active { opacity: 1; color: var(--text-main); }
.auth-progress__n { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 0.7rem; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.auth-progress li.is-active .auth-progress__n { background: linear-gradient(180deg, var(--color-brand-200), var(--color-brand-500)); color: var(--color-brand-900); box-shadow: none; }
.auth-progress__bar { flex: 1; height: 2px; border-radius: 2px; background: var(--border); }
.auth-progress[data-step="2"] .auth-progress__bar { background: linear-gradient(90deg, var(--color-brand-500), var(--color-brand-200)); }

/* گام‌ها */
.auth-step[hidden] { display: none; }
.auth-step form { display: flex; flex-direction: column; gap: 12px; }
@keyframes stepExit { to { opacity: 0; transform: translateY(-8px) scale(0.985); } }
@keyframes stepEnter { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }
.auth-step--exit { animation: stepExit 180ms cubic-bezier(0.4, 0, 0.2, 1) forwards; pointer-events: none; }
.auth-step--enter { animation: stepEnter 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }

.field-label { font-size: 0.82rem; font-weight: 700; color: var(--text-2, var(--text-main)); }
.field-hint { margin: -4px 0 0; font-size: 0.78rem; color: var(--text-muted); }

/* شماره: پیشوند و ورودی یک کپسول */
.tel {
  display: flex;
  direction: ltr;
  align-items: stretch;
  height: 56px;
  border-radius: 16px;
  background: var(--surface-1);
  box-shadow: inset 0 0 0 1.5px var(--border);
  transition: box-shadow 0.15s ease;
  overflow: hidden;
}
.tel:focus-within { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 4px rgba(229, 170, 23, 0.16); }
.tel__prefix { display: grid; place-items: center; padding-inline: 14px; font-weight: 800; color: var(--text-muted); background: var(--surface-2); border-inline-end: 1px solid var(--border); font-size: 0.95rem; }
.tel__input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding-inline: 14px; font: inherit; font-size: 1.15rem; font-weight: 700; letter-spacing: 0.5px; color: var(--text-main); text-align: left; }
.tel__input::placeholder { color: var(--color-ink-300, #b9b0a0); font-weight: 600; }

/* پیام */
.form-msg { font-size: 0.84rem; line-height: 1.8; color: #a3302b; background: rgba(199, 74, 69, 0.09); border-radius: 12px; padding: 8px 12px; }
.form-msg[hidden] { display: none; }

/* دکمهٔ اصلی */
.auth-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 54px; margin-top: 2px;
  border-radius: 16px; border: 1px solid rgba(157, 112, 14, 0.32);
  background: linear-gradient(180deg, var(--color-brand-200) 0%, var(--color-brand-500) 100%);
  color: var(--color-brand-900); font: inherit; font-size: 1rem; font-weight: 800; cursor: pointer;
  box-shadow: 0 10px 22px rgba(229, 170, 23, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.auth-btn:active:not(:disabled) { transform: translateY(1px) scale(0.995); }
.auth-btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.auth-btn:focus-visible, .auth-resend:focus-visible, .auth-edit:focus-visible, .auth-terms a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 10px; }
.btn-spinner { display: none; width: 20px; height: 20px; animation: spinnerRotate 0.8s linear infinite; }
.auth-btn.is-loading .btn-label { opacity: 0.6; }
.auth-btn.is-loading .btn-spinner { display: block; }
@keyframes spinnerRotate { to { transform: rotate(360deg); } }

/* گام کد */
.auth-sent { margin: 0; font-size: 0.9rem; line-height: 2; color: var(--text-2, var(--text-main)); }
.auth-sent__num { display: inline-block; padding: 0 6px; border-radius: 8px; background: var(--surface-2); font-weight: 800; letter-spacing: 0.3px; }
.auth-edit { margin-inline-start: 6px; border: 0; background: none; padding: 2px 4px; font: inherit; font-size: 0.85rem; font-weight: 800; color: var(--color-brand-700, #9d700e); cursor: pointer; }

.otp { position: relative; }
.otp-cells { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.otp-cell {
  display: grid; place-items: center; height: 58px; border-radius: 14px;
  background: var(--surface-1); box-shadow: inset 0 0 0 1.5px var(--border);
  font-size: 1.45rem; font-weight: 800; color: var(--text-main);
  transition: box-shadow 0.15s ease, background-color 0.15s ease, transform 0.12s ease;
}
.otp-cell.is-filled { background: rgba(229, 170, 23, 0.07); box-shadow: inset 0 0 0 1.5px var(--accent); }
.otp-cell.is-active { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 4px rgba(229, 170, 23, 0.16); }
/* ورودی واقعی روی خانه‌ها: نامرئی ولی فوکوس‌پذیر (autofill iOS/اندروید و paste بومی) */
.otp-input { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; outline: 0; padding: 0; background: transparent; color: transparent; caret-color: transparent; font-size: 16px; text-align: center; letter-spacing: 1em; -webkit-appearance: none; appearance: none; }
.otp-input:focus, .otp-input:focus-visible { box-shadow: none; outline: 0; border: 0; background: transparent; }
.otp.is-shake { animation: otpShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes otpShake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.auth-resend { align-self: center; border: 0; background: none; padding: 8px 10px; font: inherit; font-size: 0.85rem; font-weight: 700; color: var(--color-brand-700, #9d700e); cursor: pointer; }
.auth-resend:disabled { color: var(--text-muted); cursor: default; }

.auth-terms { margin: 0; text-align: center; font-size: 0.75rem; line-height: 1.9; color: var(--text-muted); }
.auth-terms a { color: var(--text-main); font-weight: 700; text-decoration: underline; text-decoration-color: rgba(42, 38, 33, 0.25); text-underline-offset: 3px; }

/* ---------- دسکتاپ: کارت + ستون «چرا کارمت» ---------- */
@media (min-width: 900px) {
  .auth-shell { grid-template-columns: minmax(0, 420px) minmax(0, 380px); justify-content: center; align-items: center; gap: 64px; }
  .auth-aside { display: flex; flex-direction: column; gap: 18px; }
  .auth-aside__title { margin: 0; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.2px; color: var(--text-muted); }
  .auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
  .auth-points li { display: flex; gap: 12px; align-items: flex-start; }
  .auth-points__ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; color: #7a5307; background: linear-gradient(160deg, #fff4d0, #f6d77e); box-shadow: inset 0 0 0 1px rgba(200, 143, 16, 0.35), 0 3px 8px rgba(200, 143, 16, 0.18); }
  .auth-points__ico svg { width: 21px; height: 21px; }
  .auth-points strong { display: block; font-size: 0.95rem; font-weight: 800; color: var(--text-main); margin-bottom: 2px; }
  .auth-points span:not(.auth-points__ico) { display: block; font-size: 0.84rem; line-height: 1.85; color: var(--text-muted); }
}

@media (max-width: 360px) {
  .otp-cells { gap: 6px; }
  .otp-cell { height: 52px; font-size: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  .page::before, .page::after, .btn-spinner { animation: none; }
  .auth-step--exit, .auth-step--enter, .otp.is-shake { animation: none; }
  .auth-btn, .otp-cell, .tel { transition: none; }
}
