/* Asset v3 ====================================================
   auth.css — تم دارک-نئونِ صفحات ورود و ثبت‌نام (cafe-gpt)
   فونت: IRANYekanXVF
   ============================================================ */

:root {
  --neon-cyan:   #22d3ee;
  --neon-blue:   #3b82f6;
  --neon-violet: #a855f7;
  --neon-pink:   #ec4899;
  --neon-grad: linear-gradient(110deg, #22d3ee 0%, #6366f1 45%, #ec4899 100%);
  --ink:    #eaf2ff;
  --muted:  #8ea2c0;
  --bg-0:   #070a16;
  --bg-1:   #0c1226;
  --card:   rgba(18, 24, 48, 0.62);
  --border: rgba(120, 160, 255, 0.18);
  --error:  #fb7185;
  --glow-cyan:   0 0 0 3px rgba(34, 211, 238, 0.18);
  --glow-violet: 0 0 0 3px rgba(168, 85, 247, 0.20);
}

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

.auth-page {
  font-family: 'IRANYekanXVF', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  background: var(--bg-0);
  position: relative;
  overflow: hidden;
}
/* هاله‌های نئونِ متحرک پس‌زمینه */
.auth-page::before,
.auth-page::after {
  content: "";
  position: fixed;
  width: 60vmax; height: 60vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .55;
  z-index: 0;
  pointer-events: none;
}
.auth-page::before {
  background: radial-gradient(circle, rgba(34,211,238,.55), transparent 60%);
  top: -22vmax; right: -14vmax;
  animation: floatA 16s ease-in-out infinite alternate;
}
.auth-page::after {
  background: radial-gradient(circle, rgba(168,85,247,.50), transparent 60%);
  bottom: -24vmax; left: -16vmax;
  animation: floatB 18s ease-in-out infinite alternate;
}
@keyframes floatA { to { transform: translate(-6vmax, 8vmax) scale(1.12); } }
@keyframes floatB { to { transform: translate(7vmax, -6vmax) scale(1.16); } }

.auth-shell {
  min-height: 100vh;
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px 18px; gap: 24px;
}

/* ---- Brand ---- */
.auth-brand { display: flex; justify-content: center; }
.auth-logo { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.auth-logo img { width: 40px; height: 40px; object-fit: contain; }
.auth-logo strong {
  display: block; font-size: 22px; font-weight: 800; line-height: 1.2;
  background: var(--neon-grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 14px rgba(99,102,241,.45));
}
.auth-logo span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ---- Card (glass + neon border) ---- */
.auth-card {
  width: 100%; max-width: 430px;
  background: var(--card);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px 28px;
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
  animation: authIn .4s cubic-bezier(.2,.7,.3,1);
}
/* خط نئونِ دور کارت */
.auth-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: 25px; padding: 1px;
  background: var(--neon-grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .65; pointer-events: none;
}
@keyframes authIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.auth-step[hidden] { display: none; }

.auth-card-head { margin-bottom: 22px; text-align: center; }
.auth-card-head h1 { font-size: 24px; font-weight: 800; color: #fff; }
.auth-card-head p { margin-top: 10px; font-size: 14px; line-height: 1.9; color: var(--muted); }
.auth-card-head strong { color: var(--neon-cyan); font-weight: 700; }

.auth-otp-icon {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px;
  display: grid; place-items: center; font-size: 26px; color: #fff;
  background: var(--neon-grad);
  box-shadow: 0 0 30px rgba(99,102,241,.55);
}

/* ---- Form ---- */
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.auth-field { display: flex; flex-direction: column; gap: 7px; }
.auth-field > span { font-size: 13px; font-weight: 600; color: #c7d6f0; }
/* That pale blue is the dark theme's label; on the light card it all but
   vanished (1.4:1), and it names the only field on the page. */
html.theme-light .auth-field > span { color: #334155; }
.auth-field > span i { color: var(--error); font-style: normal; }
.auth-field > span small { color: var(--muted); }

.auth-field input {
  width: 100%; font-family: inherit; font-size: 14.5px; color: #fff;
  background: rgba(8, 12, 28, 0.7);
  border: 1.5px solid var(--border);
  border-radius: 13px; padding: 13px 15px; outline: none;
  transition: border-color .15s, box-shadow .2s, background .2s;
}
.auth-field input::placeholder { color: #5e6f8e; }
.auth-field input:focus {
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan), 0 0 18px rgba(34,211,238,.25);
  background: rgba(10, 16, 36, 0.9);
}
.auth-field input[dir="ltr"] { letter-spacing: .5px; }
.auth-field input.error,
.auth-field input[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 3px rgba(251,113,133,.18); }

/* پیشوند @ نام کاربری */
.auth-input-prefix { position: relative; display: flex; align-items: stretch; }
.auth-input-prefix input { flex: 1; }
.auth-input-prefix .prefix {
  display: flex; align-items: center; padding: 0 12px;
  font-size: 13px; font-weight: 700; color: var(--neon-cyan);
  background: rgba(34,211,238,.08);
  border: 1.5px solid var(--border);
}

/* خطاها */
.auth-error { font-size: 12.5px; color: var(--error); line-height: 1.6; }
.auth-error:empty { display: none; }
.auth-error.hidden { display: none; }
.auth-hint { font-size: .78rem; color: var(--muted) !important; margin-top: 3px; }

/* ---- Buttons ---- */
.auth-submit {
  width: 100%; font-family: inherit; font-size: 15px; font-weight: 800; color: #fff;
  background: var(--neon-grad); background-size: 200% 100%;
  border: 0; border-radius: 13px; padding: 15px; cursor: pointer;
  transition: background-position .4s, transform .1s, box-shadow .2s, filter .2s;
  box-shadow: 0 10px 30px rgba(99,102,241,.40), 0 0 18px rgba(34,211,238,.25);
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px;
  letter-spacing: .3px;
}
.auth-submit:hover { background-position: 100% 0; transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 14px 36px rgba(236,72,153,.40), 0 0 26px rgba(34,211,238,.35); }
.auth-submit:active { transform: scale(.99); }
.auth-submit:disabled { opacity: .55; cursor: not-allowed; transform: none; filter: grayscale(.3); }

.auth-back {
  width: 100%; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--muted);
  background: transparent; border: 1.5px solid var(--border); border-radius: 13px;
  padding: 12px; cursor: pointer; transition: .2s; margin-top: 10px;
}
.auth-back:hover { background: rgba(34,211,238,.08); color: var(--neon-cyan); border-color: rgba(34,211,238,.4); }

/* ---- Alt / terms links ---- */
.auth-alt { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.auth-alt a { color: var(--neon-cyan); font-weight: 700; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }
.auth-terms { text-align: center; font-size: 12.5px; color: var(--muted); }

/* ---- OTP digits ---- */
.otp-inputs { display: flex; gap: 9px; justify-content: center; }
.otp-inputs input {
  width: 46px; height: 56px; text-align: center;
  font-family: inherit; font-size: 22px; font-weight: 800; color: #fff;
  background: rgba(8,12,28,.7); border: 1.5px solid var(--border); border-radius: 13px;
  outline: none; transition: border-color .15s, box-shadow .2s, background .2s, transform .1s;
}
.otp-inputs input:focus { border-color: var(--neon-violet); box-shadow: var(--glow-violet), 0 0 16px rgba(168,85,247,.3); }
.otp-inputs input.is-filled,
.otp-inputs input.filled {
  border-color: var(--neon-cyan);
  background: rgba(34,211,238,.12);
  box-shadow: 0 0 16px rgba(34,211,238,.35); transform: translateY(-1px);
}
.otp-inputs input.error-state { border-color: var(--error); box-shadow: 0 0 0 3px rgba(251,113,133,.18); }
.otp-form.has-error .otp-inputs input { border-color: var(--error); }

/* ---- OTP heading ---- */
.otp-heading { text-align: center; margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.otp-heading > span { font-size: 12.5px; color: var(--muted); }
.otp-heading strong { font-size: 18px; font-weight: 800; color: #fff; }
.otp-heading small { font-size: 13px; color: var(--neon-cyan); }

.otp-form[hidden] { display: none; }
.login-panel.is-otp .phone-form { display: none; }
.auth-form[aria-hidden="true"] { display: none; }

footer { color: var(--muted) !important; }

@media (max-width: 440px) {
  .auth-card { padding: 24px 20px; border-radius: 20px; }
  .otp-inputs input { width: 42px; height: 52px; font-size: 19px; }
}


/* ── Theme switch ──────────────────────────────────────────────────────────
   Positioned rather than placed in the flow: the card is vertically centred
   and any sibling above it would push it off centre.                       */
/* Pinned to the physical left. The page is right-to-left, so the logical
   inset-inline-start put the switch on the right, where the "back to home"
   link also sits — on phones the two overlapped. */
.auth-theme-switch {
  position: fixed;
  top: 18px;
  left: 18px;
  right: auto;
  z-index: 20;
}

@media (max-width: 640px) {
  /* Same top offset as the home link, so the two read as one row. */
  .auth-theme-switch { top: 12px; left: 12px; }
}

/* Sized here rather than with utility classes: this page loads no Tailwind. */
.auth-theme-switch .cafe-theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
}

.auth-theme-switch .cafe-theme-toggle:hover {
  border-color: var(--neon-cyan);
}

/* Without this both icons render until Alpine initialises. */
[x-cloak] { display: none !important; }

/* ============================================================================
   Day mode
   The palette at the top is variable-driven and day mode redefines those, but
   the glows and a handful of text colours below were written as literal rgba
   and #fff — so they stayed lit for the dark card. This block answers exactly
   those, and nothing that already follows a variable.
   ========================================================================= */

/* Glows sized for a near-black ground read as coloured haze on paper. */
html.theme-light .auth-submit {
  box-shadow: 0 6px 18px rgba(237, 124, 34, 0.22);
}

html.theme-light .auth-submit:hover {
  box-shadow: 0 8px 22px rgba(237, 124, 34, 0.30);
}

html.theme-light .auth-otp-icon {
  box-shadow: 0 6px 18px rgba(237, 124, 34, 0.20);
}

html.theme-light .auth-field input:focus {
  box-shadow: 0 0 0 3px rgba(237, 124, 34, 0.16);
}

html.theme-light .otp-inputs input:focus {
  border-color: var(--orange-primary, #ed7c22);
  box-shadow: 0 0 0 3px rgba(237, 124, 34, 0.18);
}

html.theme-light .otp-inputs input.is-filled,
html.theme-light .otp-inputs input.filled {
  box-shadow: 0 2px 8px rgba(237, 124, 34, 0.18);
}

html.theme-light .otp-inputs input.error-state {
  box-shadow: 0 0 0 3px rgba(180, 36, 63, 0.16);
}

/* Text that was white because the card was dark. The submit button keeps its
   white label — it sits on a filled orange plate. */
html.theme-light .auth-card-head h1,
html.theme-light .auth-field input,
html.theme-light .otp-inputs input,
html.theme-light .otp-heading strong {
  color: #1c1c1c;
}
.auth-home-link{position:fixed;top:22px;right:24px;z-index:20;display:flex;align-items:center;gap:7px;padding:9px 14px;border:1px solid rgba(125,211,252,.3);border-radius:999px;color:#cbd5e1;background:rgba(15,23,42,.72);backdrop-filter:blur(12px);font-size:12px;font-weight:700;transition:.2s ease}.auth-home-link:hover{color:#fff;border-color:#22d3ee;transform:translateY(-1px)}.theme-light .auth-home-link{color:#475569;background:rgba(255,255,255,.86);border-color:rgba(14,116,144,.2)}@media(max-width:640px){.auth-home-link{top:12px;right:12px}.auth-home-link span{display:none}}

/* The home link is a pill button; the browser's link underline does not belong on it. */
.auth-home-link,
.auth-home-link:hover,
.auth-home-link:focus-visible {
  text-decoration: none;
}

/* Typed OTP digits in the brand orange, in both themes. !important because
   light-theme.css, loaded after this file, sets every input's colour with it. */
.otp-inputs input,
html.theme-light .otp-inputs input {
  color: var(--orange-primary, #ed7c22) !important;
}

/* ---- Sign in with Google ---- */
.auth-divider {
  display: flex; align-items: center; gap: 12px; margin-top: 14px;
  font-size: 12.5px; color: var(--muted);
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.auth-google {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 12px; padding: 13px; border-radius: 13px;
  font-family: inherit; font-size: 14.5px; font-weight: 700; text-decoration: none;
  color: var(--ink); background: rgba(255,255,255,.04); border: 1.5px solid var(--border);
  transition: background .2s, border-color .2s, transform .1s;
}
.auth-google:hover { background: rgba(255,255,255,.08); border-color: rgba(120,160,255,.38); transform: translateY(-1px); }
.auth-google:active { transform: scale(.99); }
.auth-google svg { flex-shrink: 0; }

html.theme-light .auth-google { background: #fff; border-color: rgba(15, 23, 42, 0.14); }
html.theme-light .auth-google:hover { background: #f8fafc; border-color: rgba(15, 23, 42, 0.26); }
