/*
 * Shared shell for the auth pages (login, forgot-password, signup): marquee
 * background, floating card, circular logo badge, and the custom login /
 * forgot-password form controls. Signup's actual field markup comes from
 * aMember's own _form.phtml, so its input styling lives in layout-signup.phtml
 * (existing .am-row/.am-element-title selectors, retoned) — this file only
 * covers the shell + the fully custom login/sendpass forms.
 *
 * Has its own dark/light toggle (same .sz-theme-toggle as the dashboard).
 * Light = clean, doc-aligned, no glow. Dark = a moody near-black + violet-glow
 * look based on a client-provided reference, recolored from its original blue.
 * Both defined as local --sz-auth-* custom properties on .sz-auth-page so the
 * rest of this file never branches on theme directly — only the two variable
 * blocks below do.
 */

.sz-auth-page {
  /* Light (default) */
  --sz-auth-bg: #F8FAFC;
  --sz-auth-panel: #FFFFFF;
  --sz-auth-panel-2: #FFFFFF;
  --sz-auth-line: #E2E8F0;
  --sz-auth-violet: #6D28D9;
  --sz-auth-violet-bright: #6D28D9;
  --sz-auth-white: #0F172A;
  --sz-auth-muted: #475569;
  --sz-auth-muted-2: #94A3B8;
  --sz-auth-input-bg: #F8FAFC;
  --sz-auth-input-bg-focus: #FFFFFF;
  --sz-auth-card-shadow: 0 20px 60px -20px rgba(15, 23, 42, 0.18);
  --sz-auth-btn-shadow: none;
  --sz-auth-btn-hover-shadow: none;
  --sz-auth-btn-text: #FFFFFF;
  --sz-auth-badge-bg: #F7F3FF;
  --sz-auth-badge-border: #E2E8F0;
  --sz-auth-badge-glow: none;
  --sz-auth-wash: none;
  --sz-auth-marquee-color: rgba(109, 40, 217, 0.05);
  --sz-auth-link-hover: #5B21B6;
  --sz-auth-success-bg: #F0FDF4;
  --sz-auth-success-text: #166534;
  --sz-auth-success-border: #BBF7D0;
  --sz-auth-danger-bg: #FEF2F2;
  --sz-auth-danger-text: #B91C1C;
  --sz-auth-danger-border: #FECACA;
  --sz-auth-info-bg: #F7F3FF;
  --sz-auth-info-border: #DDD0FF;

  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  position: relative;
  overflow-x: hidden;
  background: var(--sz-auth-bg);
  color: var(--sz-auth-white);
  transition: background 0.2s ease;
}

/* Dark */
:root[data-theme="dark"] .sz-auth-page {
  --sz-auth-bg: #0A0E16;
  --sz-auth-panel: #141B29;
  --sz-auth-panel-2: #0A0F1A;
  --sz-auth-line: #232D40;
  --sz-auth-violet: #7C3AED;
  --sz-auth-violet-bright: #A78BFA;
  --sz-auth-white: #F8FAFC;
  --sz-auth-muted: #94A3B8;
  --sz-auth-muted-2: #64748B;
  --sz-auth-input-bg: #0D1220;
  --sz-auth-input-bg-focus: #101627;
  --sz-auth-card-shadow: 0 40px 100px -30px rgba(124, 58, 237, 0.35), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --sz-auth-btn-shadow: 0 14px 30px -10px rgba(124, 58, 237, 0.6);
  --sz-auth-btn-hover-shadow: 0 18px 34px -10px rgba(124, 58, 237, 0.7);
  --sz-auth-btn-text: #05040A;
  /* Kept light/white (not dark) on purpose: the SZ mark itself is dark-on-transparent, drawn to sit on
     a light badge — a dark badge background makes the logo nearly disappear, as reported. */
  --sz-auth-badge-bg: #FFFFFF;
  --sz-auth-badge-border: rgba(167, 139, 250, 0.6);
  --sz-auth-badge-glow: 0 0 30px rgba(124, 58, 237, 0.4);
  --sz-auth-wash:
    radial-gradient(ellipse 900px 560px at 18% -5%, rgba(124, 58, 237, 0.18), transparent 60%),
    radial-gradient(ellipse 750px 540px at 100% 105%, rgba(124, 58, 237, 0.12), transparent 60%);
  --sz-auth-marquee-color: rgba(124, 58, 237, 0.07);
  --sz-auth-link-hover: #C4B5FD;
  --sz-auth-success-bg: rgba(34, 197, 94, 0.1);
  --sz-auth-success-text: #86EFAC;
  --sz-auth-success-border: rgba(34, 197, 94, 0.3);
  --sz-auth-danger-bg: rgba(220, 38, 38, 0.12);
  --sz-auth-danger-text: #FCA5A5;
  --sz-auth-danger-border: rgba(220, 38, 38, 0.3);
  --sz-auth-info-bg: rgba(124, 58, 237, 0.12);
  --sz-auth-info-border: rgba(124, 58, 237, 0.3);
}

.sz-auth-wash {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--sz-auth-wash);
}

/* Rows are spread across the full page height with justify-content, not just stacked at the top. */
.sz-auth-marquee {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.55;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 0;
  box-sizing: border-box;
}
.sz-auth-marquee-row {
  white-space: nowrap;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 52px;
  letter-spacing: 2px;
  color: var(--sz-auth-marquee-color);
  animation: sz-marquee 42s linear infinite;
}
.sz-auth-marquee-row.sz-reverse { animation-direction: reverse; }
@keyframes sz-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .sz-auth-marquee-row { animation: none; }
}

.sz-auth-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3;
}

.sz-auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, var(--sz-auth-panel), var(--sz-auth-panel-2));
  border: 1px solid var(--sz-auth-line);
  border-radius: 22px;
  padding: 38px 32px;
  box-shadow: var(--sz-auth-card-shadow);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.sz-auth-badge {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sz-auth-badge-bg);
  border: 2px solid var(--sz-auth-badge-border);
  box-shadow: var(--sz-auth-badge-glow);
  overflow: hidden;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.sz-auth-badge img { width: 78%; height: 78%; object-fit: contain; }

.sz-auth-card h1 {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 24px;
  text-align: center;
  color: var(--sz-auth-white);
  margin: 0;
}
.sz-auth-card h1 span { color: var(--sz-auth-violet-bright); }
.sz-auth-card .sz-auth-sub {
  text-align: center;
  color: var(--sz-auth-muted);
  font-size: 13.5px;
  margin: 8px 0 28px;
}

.sz-field { margin-bottom: 18px; }
.sz-field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--sz-auth-white);
}
.sz-field-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sz-field-head label { margin-bottom: 0; }

.sz-input-wrap { position: relative; }
.sz-input-wrap .sz-input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--sz-auth-muted); pointer-events: none;
}
.sz-input {
  width: 100%;
  padding: 13px 14px 13px 42px;
  border-radius: 12px;
  background: var(--sz-auth-input-bg);
  border: 1px solid var(--sz-auth-line);
  color: var(--sz-auth-white);
  font-size: 14px;
  font-family: 'Space Grotesk', sans-serif;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.sz-input::placeholder { color: var(--sz-auth-muted-2); }
.sz-input:focus {
  border-color: var(--sz-auth-violet);
  background: var(--sz-auth-input-bg-focus);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}
.sz-input.sz-has-toggle { padding-right: 46px; }

.sz-eye-btn {
  position: absolute; right: 6px; top: 0; height: 100%;
  width: 38px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--sz-auth-muted); cursor: pointer;
}
.sz-eye-btn:hover { color: var(--sz-auth-violet-bright); }
.sz-eye-btn svg { width: 18px; height: 18px; }
.sz-eye-btn .sz-eye-off { display: none; }
.sz-eye-btn[data-visible="true"] .sz-eye-on { display: none; }
.sz-eye-btn[data-visible="true"] .sz-eye-off { display: block; }

.sz-btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  margin-top: 6px;
  background: linear-gradient(100deg, var(--sz-auth-violet), var(--sz-auth-violet-bright));
  color: var(--sz-auth-btn-text);
  font-weight: 700;
  font-size: 14.5px;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: var(--sz-auth-btn-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}
.sz-btn-primary:hover { transform: translateY(-2px); box-shadow: var(--sz-auth-btn-hover-shadow); }
.sz-btn-primary:active { transform: translateY(0); }
.sz-btn-primary svg { width: 18px; height: 18px; }
.sz-btn-primary:disabled { opacity: 0.7; cursor: default; transform: none; }

.sz-auth-links { text-align: center; margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.sz-auth-links a { color: var(--sz-auth-violet-bright); font-weight: 600; font-size: 13.5px; text-decoration: none; }
.sz-auth-links a:hover { color: var(--sz-auth-link-hover); text-decoration: underline; }
.sz-auth-links .sz-muted-line { color: var(--sz-auth-muted); font-size: 13.5px; }
.sz-auth-links .sz-muted-line a { color: var(--sz-auth-violet-bright); }

.sz-auth-divider { border-top: 1px solid var(--sz-auth-line); margin-top: 24px; padding-top: 20px; text-align: center; }

.sz-auth-whatsapp {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px;
  background: var(--sz-auth-success-bg); color: var(--sz-auth-success-text);
  border: 1px solid var(--sz-auth-success-border);
  font-weight: 700; font-size: 13.5px; text-decoration: none !important;
}
.sz-auth-whatsapp svg { width: 16px; height: 16px; }
.sz-auth-whatsapp:hover { filter: brightness(0.95); }

.sz-back-home { position: relative; z-index: 2; margin-top: 24px; text-align: center; color: var(--sz-auth-muted); font-size: 13.5px; }
.sz-back-home a { color: var(--sz-auth-white); font-weight: 600; text-decoration: none; }
.sz-back-home a:hover { color: var(--sz-auth-violet-bright); }

.sz-auth-msg {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  margin-bottom: 16px;
  text-align: center;
  border: 1px solid transparent;
}
.sz-auth-msg.sz-msg-success { background: var(--sz-auth-success-bg); color: var(--sz-auth-success-text); border-color: var(--sz-auth-success-border); }
.sz-auth-msg.sz-msg-danger { background: var(--sz-auth-danger-bg); color: var(--sz-auth-danger-text); border-color: var(--sz-auth-danger-border); }

/* aMember's own error/alert partials, styled to match */
.sz-auth-card .am-error,
.sz-auth-card ul.am-errors,
.sz-auth-card .alert-error,
.sz-auth-card .alert-danger {
  background: var(--sz-auth-danger-bg);
  color: var(--sz-auth-danger-text);
  border: 1px solid var(--sz-auth-danger-border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
  margin: 0 0 16px;
  list-style: none;
}

/* ---- Post-submit login loader overlay ---- */
.sz-auth-loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  background: var(--sz-auth-bg);
}
.sz-auth-loader.sz-active { display: flex; }
.sz-auth-loader-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--sz-auth-line);
  border-top-color: var(--sz-auth-violet);
  animation: sz-spin 0.8s linear infinite;
}
.sz-auth-loader-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--sz-auth-muted);
  letter-spacing: 0.02em;
}
@keyframes sz-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .sz-auth-loader-ring { animation-duration: 1.6s; }
}

@media (max-width: 480px) {
  .sz-auth-card { padding: 30px 22px; border-radius: 18px; }
  .sz-auth-marquee-row { font-size: 38px; }
}
