/* ---------------- DARK THEME (default) ---------------- */
:root,
:root[data-theme="dark"] {
  --bg-body: #0d1117;
  --glass-bg: rgba(22, 27, 34, 0.6);
  --glass-blur: blur(16px);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --primary-light: #2dd4bf;
  --primary-hover: #14b8a6;
  --primary-glow: rgba(45, 212, 191, 0.4);
  --primary-contrast: #042f2e;
  --text-primary: #ffffff;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --input-bg: rgba(0, 0, 0, 0.2);
  --outline-btn-bg: rgba(255, 255, 255, 0.06);
  --outline-btn-bg-hover: rgba(255, 255, 255, 0.1);
  --brand-gradient: linear-gradient(135deg, rgba(15, 123, 108, 0.1) 0%, rgba(22, 27, 34, 0.8) 100%);
  --dot-pattern-color: rgba(255, 255, 255, 0.08);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  color-scheme: dark;
}

/* ---------------- LIGHT THEME ---------------- */
:root[data-theme="light"] {
  --bg-body: #f1f4f9;
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-blur: blur(16px);
  --glass-border: rgba(15, 23, 42, 0.09);
  --glass-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  --primary-light: #0d9488;
  --primary-hover: #0f766e;
  --primary-glow: rgba(13, 148, 136, 0.2);
  --primary-contrast: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --input-bg: #ffffff;
  --outline-btn-bg: rgba(15, 23, 42, 0.04);
  --outline-btn-bg-hover: rgba(15, 23, 42, 0.08);
  --brand-gradient: linear-gradient(135deg, rgba(13, 148, 136, 0.08) 0%, rgba(255, 255, 255, 0.9) 100%);
  --dot-pattern-color: rgba(15, 23, 42, 0.06);
  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', system-ui, -apple-system, sans-serif; }

html { overflow-x: hidden; width: 100%; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  max-width: 100%;
  display: flex;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

img, svg { max-width: 100%; height: auto; }

/* Theme toggle - fixed top-right on auth pages */
.theme-toggle-btn {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 500;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--outline-btn-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px; color: var(--text-primary); cursor: pointer;
  font-size: 18px; transition: all 0.2s var(--ease);
  backdrop-filter: var(--glass-blur);
}
.theme-toggle-btn:hover { background: var(--outline-btn-bg-hover); transform: translateY(-1px); }

.auth-shell { display: flex; width: 100%; min-height: 100vh; }

.auth-brand {
  flex: 1;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--brand-gradient);
  border-right: 1px solid var(--glass-border);
}

.brand-top { display: flex; align-items: center; gap: 16px; margin-bottom: 40px; }
/* Size comes from the inline style set by includes/brand-logo.php. */
.brand-logo {
  width: 110px; height: 110px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #059669;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden; padding: 0;
  box-shadow: 0 0 20px var(--primary-glow);
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Shown only if hercorlogo.jpg is missing or fails to load. */
.brand-logo-text {
  display: none;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  color: #059669;
  letter-spacing: 0.02em;
  line-height: 1;
}
.brand-logo-fallback .brand-logo-text { display: block; }
.brand-kicker { font-family: 'Space Grotesk', sans-serif; font-size: 1.4rem; font-weight: 800; color: var(--text-primary); }
.brand-sub { color: var(--primary-light); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* Access-level badge shown above the sign-up heading, so it's
   immediately clear whether this page is a restricted Super Admin
   action or a one-time first-run setup step, instead of relying on
   the admin to read the paragraph underneath to find that out. */
.access-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}
.access-badge-super {
  background: rgba(251, 191, 36, 0.14);
  color: #b45309;
  border: 1px solid rgba(251, 191, 36, 0.4);
}
:root[data-theme="dark"] .access-badge-super { color: #fbbf24; }
.access-badge-setup {
  background: rgba(56, 189, 248, 0.14);
  color: #0369a1;
  border: 1px solid rgba(56, 189, 248, 0.4);
}
:root[data-theme="dark"] .access-badge-setup { color: #38bdf8; }

.brand-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.8rem;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-copy { font-size: 1.1rem; color: var(--text-secondary); line-height: 1.6; max-width: 420px; }

.auth-panel {
  flex: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background-image: radial-gradient(var(--dot-pattern-color) 1px, transparent 1px);
  background-size: 24px 24px;
}

.auth-card {
  width: 100%;
  max-width: 520px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 48px;
  box-shadow: var(--glass-shadow);
  animation: fadeInUp 0.6s var(--ease);
}

.auth-eyebrow { color: var(--primary-light); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; }
.auth-heading { font-family: 'Space Grotesk', sans-serif; font-size: 2rem; margin-bottom: 8px; color: var(--text-primary); }
.auth-desc { color: var(--text-secondary); margin-bottom: 32px; font-size: 0.95rem; }

.auth-form { display: flex; flex-direction: column; gap: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.input-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 8px; color: var(--text-primary); }
.input-group input {
  width: 100%;
  padding: 14px 16px;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s var(--ease);
}
.input-group input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 4px var(--primary-glow); }

.auth-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary-light);
  color: var(--primary-contrast);
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, background 0.3s;
  margin-top: 10px;
}
.auth-btn:hover { background: var(--primary-hover); transform: translateY(-2px); }

.auth-links { margin-top: 24px; text-align: center; font-size: 0.9rem; color: var(--text-muted); }
.auth-links a { color: var(--primary-light); text-decoration: none; font-weight: 500; }
.auth-links a:hover { color: var(--text-primary); text-decoration: underline; }

.alert {
  padding: 13px 16px; border-radius: 10px; font-size: 0.85rem; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.alert-success { background: rgba(16,185,129,0.1); color: #0d9488; border: 1px solid rgba(16,185,129,0.3); }
:root[data-theme="dark"] .alert-success { color: #10b981; }
.alert-error { background: rgba(248,113,113,0.1); color: #f87171; border: 1px solid rgba(248,113,113,0.3); }
:root[data-theme="light"] .alert-error { color: #b91c1c; }

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@media (max-width: 992px) {
  .auth-shell { flex-direction: column; }
  .auth-brand { border-right: none; border-bottom: 1px solid var(--glass-border); padding: 40px; }
  .brand-title { font-size: 2.1rem; }
}

@media (max-width: 576px) {
  .auth-brand { padding: 28px; }
  .auth-panel { padding: 20px; }
  .auth-card { padding: 28px 22px; }
  .form-row { grid-template-columns: 1fr; }
  .brand-title { font-size: 1.7rem; }
  .brand-copy { font-size: 0.95rem; }
  .theme-toggle-btn { top: 14px; right: 14px; }
}
/* =========================================================
   PASSWORD SHOW / HIDE TOGGLE
   ---------------------------------------------------------
   Rules are scoped through .password-field and carry !important
   on the reset properties: the generic `.auth-btn` / `.input-group
   input` rules above would otherwise paint the toggle as a full
   button and push it out of the field, which is exactly what made
   the icons stack underneath the box.
   ========================================================= */
.password-field {
  position: relative;
  display: block;
  width: 100%;
}

.input-group .password-field input {
  width: 100%;
  padding-right: 48px !important; /* room for the icon */
}

.password-field .password-toggle {
  position: absolute !important;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 8px;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 2;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.password-field .password-toggle:hover {
  color: var(--primary-light);
  background: var(--outline-btn-bg-hover) !important;
}

.password-field .password-toggle:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

/* Keeps exactly one eye visible. Without the !important a later
   generic `svg { display: block }` rule would show both at once. */
.password-toggle svg { display: block; }
.password-toggle svg[hidden] { display: none !important; }

/* Suppress Edge/IE's own reveal control so there are never two icons. */
.password-field input::-ms-reveal,
.password-field input::-ms-clear { display: none; }

/* Caps-Lock warning shown under the password field. */
.caps-warning {
  display: none;
  margin-top: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-gold, #d97706);
}
.caps-warning.is-visible { display: block; }

/* =========================================================
   LOGIN v2 — glassmorphism split screen
   ---------------------------------------------------------
   Appended, so it overrides the earlier rules without those
   having to be deleted. The mobile rules at the bottom are
   the important part: the card must fit a phone without a
   "Desktop site" tap and without sideways scrolling.
   ========================================================= */

:root {
  --gx-cyan:   #22d3ee;
  --gx-blue:   #3b82f6;
  --gx-purple: #8b5cf6;
  --gx-navy:   #070d1a;
  --gx-glass:  rgba(255, 255, 255, .055);
  --gx-border: rgba(255, 255, 255, .13);
}

html, body { max-width: 100%; overflow-x: hidden; }

body {
  min-height: 100svh;                /* svh, so mobile browser chrome can't clip it */
  background:
    radial-gradient(1100px 620px at 12% 18%, rgba(34,211,238,.16), transparent 60%),
    radial-gradient(980px 560px at 88% 78%, rgba(139,92,246,.20), transparent 62%),
    radial-gradient(760px 520px at 62% 10%, rgba(59,130,246,.13), transparent 60%),
    linear-gradient(160deg, #070d1a 0%, #0a1426 45%, #0b1020 100%);
  color: #e8eef8;
}

/* ---- background effects ---- */
.bg-fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.fx-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at 50% 40%, #000 10%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 10%, transparent 78%);
}
.fx-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; }
.fx-orb-cyan   { width: 380px; height: 380px; top: -90px;  left: -80px;  background: #22d3ee; }
.fx-orb-purple { width: 440px; height: 440px; bottom: -140px; right: -90px; background: #8b5cf6; }
.fx-orb-blue   { width: 300px; height: 300px; top: 44%; left: 46%; background: #3b82f6; opacity: .3; }
@media (prefers-reduced-motion: no-preference) {
  .fx-orb { animation: fx-float 16s ease-in-out infinite alternate; }
  .fx-orb-purple { animation-duration: 21s; }
  .fx-orb-blue   { animation-duration: 26s; }
}
@keyframes fx-float { from { transform: translate3d(0,0,0) scale(1); }
                      to   { transform: translate3d(24px,-26px,0) scale(1.08); } }

/* ---- shell ---- */
.auth-shell {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  min-height: 100svh;
  width: 100%;
  padding: clamp(20px, 4vw, 56px);
  margin: 0 auto; max-width: 1400px;
}

/* ---- left: branding ---- */
.auth-brand { display: flex; flex-direction: column; gap: clamp(20px, 3vw, 38px); min-width: 0; }
.brand-top { display: flex; align-items: center; gap: 16px; }
.brand-kicker { font-size: clamp(1.15rem, 2.4vw, 1.6rem); font-weight: 800; letter-spacing: -.02em; }
.brand-sub {
  font-size: .72rem; font-weight: 700; letter-spacing: .17em;
  text-transform: uppercase; color: #7dd3fc;
}
.brand-sub-dim { color: rgba(232,238,248,.5); letter-spacing: .14em; }

.brand-title {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(1.7rem, 4.4vw, 3.1rem);
  font-weight: 800; line-height: 1.12; letter-spacing: -.025em; margin: 0 0 14px;
}
.grad-text {
  background: linear-gradient(100deg, #22d3ee 0%, #60a5fa 45%, #a78bfa 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.brand-copy {
  font-size: clamp(.88rem, 1.6vw, 1rem); line-height: 1.65;
  color: rgba(232,238,248,.7); max-width: 46ch; margin: 0;
}

.feature-cards {
  list-style: none; margin: clamp(20px, 3vw, 32px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
}
.feature-card {
  display: flex; align-items: center; gap: 11px;
  padding: 13px; border-radius: 16px;
  background: var(--gx-glass); border: 1px solid var(--gx-border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.feature-card:hover { transform: translateY(-3px); border-color: rgba(34,211,238,.45); background: rgba(34,211,238,.08); }
.feature-ico {
  display: grid; place-items: center; flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(135deg, rgba(34,211,238,.22), rgba(139,92,246,.22));
  border: 1px solid var(--gx-border); color: #7dd3fc;
}
.feature-ico svg { width: 17px; height: 17px; }
.feature-card div { display: flex; flex-direction: column; min-width: 0; }
.feature-card strong { font-size: .78rem; font-weight: 700; }
.feature-card span { font-size: .68rem; color: rgba(232,238,248,.55); }

/* ---- right: login card ---- */
.auth-panel { display: flex; justify-content: center; min-width: 0; }
.auth-card {
  position: relative;
  width: 100%; max-width: 470px;
  padding: clamp(24px, 3.6vw, 42px);
  border-radius: 26px;
  background: rgba(255,255,255,.065);
  border: 1px solid var(--gx-border);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  box-shadow: 0 28px 70px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.14);
}
/* Gradient hairline around the card, drawn as a masked border so it stays
   crisp without a wrapper element. */
.auth-card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(140deg, rgba(34,211,238,.65), rgba(139,92,246,.5), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

.auth-eyebrow {
  display: inline-block; padding: 5px 12px; margin-bottom: 16px;
  border-radius: 999px; font-size: .63rem; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase; color: #7dd3fc;
  background: rgba(34,211,238,.12); border: 1px solid rgba(34,211,238,.3);
}
.auth-heading {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(1.5rem, 3.4vw, 2rem); font-weight: 800;
  letter-spacing: -.02em; margin: 0 0 8px;
}
.auth-desc { font-size: .86rem; line-height: 1.6; color: rgba(232,238,248,.62); margin: 0 0 24px; }

.auth-form .input-group { margin-bottom: 17px; position: relative; }
.auth-form label {
  display: block; margin-bottom: 7px;
  font-size: .74rem; font-weight: 600; letter-spacing: .03em;
  color: rgba(232,238,248,.78);
}
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  width: 100%; padding: 13px 15px; border-radius: 14px;
  background: rgba(8,14,28,.6); border: 1px solid var(--gx-border);
  color: #e8eef8; font-size: .9rem; font-family: inherit;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.auth-form input::placeholder { color: rgba(232,238,248,.34); }
.auth-form input:focus {
  outline: none; border-color: rgba(34,211,238,.75);
  background: rgba(8,14,28,.8);
  box-shadow: 0 0 0 4px rgba(34,211,238,.14), 0 0 22px rgba(34,211,238,.2);
}

/* Icon sits inside the field; the input gets matching padding so text
   never runs underneath it. */
.input-group.has-ico .field-ico,
.input-group.password-group .field-ico {
  position: absolute; left: 14px; top: 38px;
  width: 17px; height: 17px; color: rgba(232,238,248,.42); pointer-events: none;
}
.input-group.has-ico .field-ico svg { width: 100%; height: 100%; }
.input-group.has-ico input { padding-left: 42px; }

/* The existing show/hide button keeps its markup and behaviour. */
.password-group { position: relative; }
.password-group input { padding-right: 46px; }
.toggle-password, .password-toggle {
  border-radius: 10px; color: rgba(232,238,248,.55);
  transition: color .15s, background .15s;
}
.toggle-password:hover, .password-toggle:hover { color: #7dd3fc; background: rgba(34,211,238,.12); }

.auth-btn {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; margin-top: 8px; padding: 14px 20px;
  border: 0; border-radius: 15px; cursor: pointer;
  font-family: inherit; font-size: .93rem; font-weight: 700; letter-spacing: .01em;
  color: #06121f;
  background: linear-gradient(100deg, #22d3ee 0%, #3b82f6 52%, #8b5cf6 100%);
  background-size: 190% 100%;
  box-shadow: 0 10px 30px rgba(59,130,246,.35);
  transition: background-position .45s ease, transform .18s ease, box-shadow .25s ease;
}
.auth-btn svg { width: 17px; height: 17px; }
.auth-btn:hover {
  background-position: 100% 0; transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(139,92,246,.45), 0 0 24px rgba(34,211,238,.3);
}
.auth-btn:active { transform: translateY(0); }
.auth-btn:focus-visible { outline: 3px solid rgba(34,211,238,.6); outline-offset: 3px; }

.auth-links { margin-top: 20px; text-align: center; font-size: .8rem; color: rgba(232,238,248,.6); }
.auth-links a { color: #7dd3fc; font-weight: 600; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

.theme-toggle-btn {
  position: fixed; top: 18px; right: 18px; z-index: 5;
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 13px; cursor: pointer; color: #e8eef8;
  background: rgba(255,255,255,.07); border: 1px solid var(--gx-border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: background .18s, border-color .18s, transform .18s;
}
.theme-toggle-btn:hover { background: rgba(34,211,238,.16); border-color: rgba(34,211,238,.5); transform: rotate(-18deg); }

.auth-form .alert, .auth-card .alert {
  border-radius: 14px; font-size: .82rem; line-height: 1.5;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

/* ---------- tablet ---------- */
@media (max-width: 1024px) {
  .auth-shell { gap: 26px; padding: 32px 26px; }
  .feature-cards { gap: 9px; }
  .feature-card { padding: 11px; }
  .feature-card span { display: none; }   /* keep three across without wrapping */
}

/* ---------- mobile ---------- */
@media (max-width: 820px) {
  .auth-shell {
    grid-template-columns: 1fr;            /* stack */
    align-content: start;
    gap: 22px;
    padding: 68px 16px 34px;               /* room for the fixed toggle */
    min-height: 100svh;
  }
  .auth-brand { gap: 16px; text-align: left; }
  .brand-top { gap: 12px; }
  .brand-top img, .brand-top svg { width: 54px !important; height: 54px !important; }
  .brand-title { font-size: 1.55rem; margin-bottom: 10px; }
  .brand-copy { font-size: .86rem; max-width: none; }

  /* Feature cards become one horizontal scroller rather than three cramped
     columns, so each stays readable and nothing overflows the viewport. */
  .feature-cards {
    grid-template-columns: none;
    display: flex; gap: 10px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 4px -16px 0; padding: 2px 16px 8px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .feature-cards::-webkit-scrollbar { display: none; }
  .feature-card { flex: 0 0 auto; min-width: 172px; scroll-snap-align: start; }
  .feature-card span { display: block; }

  .auth-panel { width: 100%; }
  .auth-card { max-width: none; padding: 22px 18px; border-radius: 22px; }
  .auth-heading { font-size: 1.4rem; }
  .auth-desc { font-size: .82rem; margin-bottom: 18px; }

  /* Never below 16px: iOS zooms the page in on focus for anything smaller,
     which is what forces people into "Desktop site". */
  .auth-form input[type="email"],
  .auth-form input[type="password"],
  .auth-form input[type="text"] { font-size: 16px; padding: 13px 14px; }
  .input-group.has-ico input { padding-left: 40px; }
  .auth-btn { padding: 15px 18px; font-size: .92rem; }
  .theme-toggle-btn { top: 14px; right: 14px; width: 38px; height: 38px; }
  .fx-orb { filter: blur(60px); opacity: .38; }
}

@media (max-width: 380px) {
  .auth-card { padding: 18px 14px; }
  .brand-title { font-size: 1.35rem; }
  .feature-card { min-width: 156px; }
}

@media (prefers-reduced-motion: reduce) {
  .fx-orb, .auth-btn, .feature-card, .theme-toggle-btn { animation: none !important; transition: none !important; }
}

/* The lock icon sits beside the field wrapper, so the inner input carries
   the padding rather than the wrapper. */
.input-group.has-ico .password-field { position: relative; }
.input-group.has-ico .password-field input { padding-left: 42px; }
@media (max-width: 820px) { .input-group.has-ico .password-field input { padding-left: 40px; } }

/* =========================================================
   LOGIN — LIGHT MODE
   ---------------------------------------------------------
   The v2 block above hard-coded a dark navy background while
   the theme variables still supplied dark text, so in light
   mode the copy was dark-on-dark and effectively invisible.
   Everything tone-dependent is restated here for light.
   ========================================================= */
:root[data-theme="light"] body {
  background:
    radial-gradient(1100px 620px at 12% 18%, rgba(13,148,136,.16), transparent 60%),
    radial-gradient(980px 560px at 88% 78%, rgba(124,58,237,.15), transparent 62%),
    radial-gradient(760px 520px at 62% 10%, rgba(37,99,235,.12), transparent 60%),
    linear-gradient(160deg, #eef3f9 0%, #e6eefa 45%, #eae7fa 100%);
  color: #0f172a;
}

/* The frosted panels need to be light-on-light, not translucent white
   over a dark base - that was what washed the left column out. */
:root[data-theme="light"] .auth-brand,
:root[data-theme="light"] .brand-body { background: none; }

:root[data-theme="light"] .fx-grid {
  background-image:
    linear-gradient(rgba(15,23,42,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,.055) 1px, transparent 1px);
}
:root[data-theme="light"] .fx-orb { opacity: .3; }
:root[data-theme="light"] .fx-orb-cyan   { background: #0d9488; }
:root[data-theme="light"] .fx-orb-purple { background: #7c3aed; }
:root[data-theme="light"] .fx-orb-blue   { background: #2563eb; }

:root[data-theme="light"] .brand-kicker { color: #0f172a; }
:root[data-theme="light"] .brand-sub     { color: #0d9488; }
:root[data-theme="light"] .brand-sub-dim { color: #556170; }
:root[data-theme="light"] .brand-title   { color: #0f172a; }
:root[data-theme="light"] .brand-copy    { color: #475569; }

/* Darker stops so the gradient word stays legible on a pale background. */
:root[data-theme="light"] .grad-text {
  background: linear-gradient(100deg, #0891b2 0%, #2563eb 45%, #7c3aed 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

:root[data-theme="light"] .feature-card {
  background: rgba(255,255,255,.78); border-color: rgba(15,23,42,.09);
  box-shadow: 0 4px 16px rgba(15,23,42,.06);
}
:root[data-theme="light"] .feature-card:hover {
  background: #fff; border-color: rgba(13,148,136,.45);
}
:root[data-theme="light"] .feature-ico {
  background: linear-gradient(135deg, rgba(13,148,136,.16), rgba(124,58,237,.16));
  border-color: rgba(15,23,42,.08); color: #0d9488;
}
:root[data-theme="light"] .feature-card strong { color: #0f172a; }
:root[data-theme="light"] .feature-card span   { color: #556170; }

:root[data-theme="light"] .auth-card {
  background: rgba(255,255,255,.82);
  border-color: rgba(15,23,42,.09);
  box-shadow: 0 24px 60px rgba(15,23,42,.13), inset 0 1px 0 rgba(255,255,255,.9);
}
:root[data-theme="light"] .auth-card::before {
  background: linear-gradient(140deg, rgba(13,148,136,.55), rgba(124,58,237,.4), transparent 70%);
}
:root[data-theme="light"] .auth-eyebrow {
  color: #0f766e; background: rgba(13,148,136,.12); border-color: rgba(13,148,136,.3);
}
:root[data-theme="light"] .auth-heading { color: #0f172a; }
:root[data-theme="light"] .auth-desc    { color: #475569; }
:root[data-theme="light"] .auth-form label { color: #334155; }

:root[data-theme="light"] .auth-form input[type="email"],
:root[data-theme="light"] .auth-form input[type="password"],
:root[data-theme="light"] .auth-form input[type="text"] {
  background: #fff; border-color: #d7dee7; color: #0f172a;
}
:root[data-theme="light"] .auth-form input::placeholder { color: #94a3b8; }
:root[data-theme="light"] .auth-form input:focus {
  background: #fff; border-color: #0d9488;
  box-shadow: 0 0 0 4px rgba(13,148,136,.15);
}
:root[data-theme="light"] .input-group.has-ico .field-ico { color: #94a3b8; }
:root[data-theme="light"] .toggle-password,
:root[data-theme="light"] .password-toggle { color: #64748b; }
:root[data-theme="light"] .password-toggle:hover { color: #0d9488; background: rgba(13,148,136,.1); }

:root[data-theme="light"] .auth-btn {
  color: #fff;
  background: linear-gradient(100deg, #0891b2 0%, #2563eb 52%, #7c3aed 100%);
  background-size: 190% 100%;
  box-shadow: 0 10px 26px rgba(37,99,235,.28);
}
:root[data-theme="light"] .auth-btn:hover {
  box-shadow: 0 16px 36px rgba(124,58,237,.3);
}

:root[data-theme="light"] .auth-links   { color: #556170; }
:root[data-theme="light"] .auth-links a { color: #0d9488; }

:root[data-theme="light"] .theme-toggle-btn {
  background: rgba(255,255,255,.9); border-color: rgba(15,23,42,.1); color: #334155;
}
:root[data-theme="light"] .theme-toggle-btn:hover {
  background: #fff; border-color: rgba(13,148,136,.5); color: #0d9488;
}
