/* ============================================================
   LumoPlans, Auth page styles (login.html)
   Midnight Current: dark glass form card + editorial aside panel.
   Loads after tokens.css and base.css.
   ============================================================ */

/* ---------- Canonical header (kept identical across pages) ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 14, 26, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  flex: 0 0 auto;
}

.brand-word {
  font-family: var(--font-display);
  font-weight: 640;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}

.brand-word em { font-style: normal; color: var(--lumo-deep); }

.site-nav {
  display: none;
  gap: var(--space-5);
  margin-inline-start: auto;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-sm);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--ink); }

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-inline-start: auto;
}

.btn-header {
  min-height: 2.5rem;
  padding: 0.45rem 1.1rem;
  font-size: var(--text-sm);
}

@media (min-width: 60rem) {
  .site-nav { display: inline-flex; }
  .site-header-actions { margin-inline-start: 0; }
}

/* ---------- Auth layout: asymmetric split ---------- */

.auth {
  min-height: calc(100vh - 4.25rem);
  display: grid;
  grid-template-columns: 1fr;
}

.auth-form-col {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-7) var(--space-4) var(--space-8);
}

.auth-card {
  width: 100%;
  max-width: 27rem;
}

.auth-eyebrow { margin-bottom: var(--space-3); }

.auth-card h1 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-2);
}

.auth-lede {
  color: var(--muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
}

/* ---------- View switcher (tabs) ---------- */

.auth-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.3rem;
  margin-bottom: var(--space-6);
  background: var(--paper-deep);
  border-radius: var(--r-pill);
}

.auth-tab {
  flex: 1;
  min-height: 2.5rem;
  padding: 0.4rem 0.5rem;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: color var(--speed-fast) ease, background-color var(--speed-fast) ease, box-shadow var(--speed-fast) ease;
}

.auth-tab:hover { color: var(--ink); }

.auth-tab[aria-selected="true"] {
  background: var(--paper-raised);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.auth-tab:focus-visible {
  outline: 2px solid var(--lumo);
  outline-offset: 2px;
}

/* ---------- Views ---------- */

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

.auth-view h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

.auth-view-lede {
  color: var(--muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-5);
}

.auth-form { display: grid; gap: var(--space-5); }

/* ---------- Fields, validation states ---------- */

.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.field-link {
  font-size: var(--text-xs);
  font-weight: 600;
}

.input-wrap { position: relative; display: block; }

.input-wrap input { width: 100%; }

.has-toggle input { padding-inline-end: 3rem; }

.pw-toggle {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  min-height: 44px;
  margin: auto 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--r-sm);
}

.pw-toggle:hover { color: var(--ink); }

.pw-toggle:focus-visible {
  outline: 2px solid var(--lumo);
  outline-offset: 2px;
}

.pw-toggle svg { width: 20px; height: 20px; }
.pw-toggle .icon-eye-off { display: none; }
.pw-toggle[aria-pressed="true"] .icon-eye { display: none; }
.pw-toggle[aria-pressed="true"] .icon-eye-off { display: block; }

/* Validation visuals, driven by JS via .is-error / .is-valid on .field */
.field.is-error input {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.field.is-valid input {
  border-color: var(--trust);
}

.field-msg {
  font-size: var(--text-xs);
  min-height: 1rem;
  color: var(--muted);
}

.field.is-error .field-msg { color: var(--danger); }

.field-hint { font-size: var(--text-xs); color: var(--muted); }

/* Password strength meter */
.pw-meter {
  display: flex;
  gap: 4px;
  margin-top: 0.35rem;
}

.pw-meter span {
  flex: 1;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--line-strong);
  transition: background-color var(--speed-fast) ease;
}

.pw-meter[data-score="1"] span:nth-child(-n+1),
.pw-meter[data-score="2"] span:nth-child(-n+2),
.pw-meter[data-score="3"] span:nth-child(-n+3),
.pw-meter[data-score="4"] span:nth-child(-n+4) { background: var(--lumo); }

.pw-meter[data-score="4"] span { background: var(--trust); }

/* Remember + submit */
.auth-remember {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: var(--text-sm);
  color: var(--ink-soft);
  cursor: pointer;
}

.auth-remember input {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  accent-color: var(--lumo);
  cursor: pointer;
}

.auth-submit { width: 100%; }

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn:disabled:hover { transform: none; box-shadow: none; }

/* ---------- Inline notices ---------- */

.auth-notice {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  background: var(--lumo-soft);
  border: 1px solid rgba(79, 141, 255, 0.25);
  color: var(--ink-soft);
}

.auth-notice svg { flex: 0 0 auto; width: 20px; height: 20px; color: var(--lumo-deep); margin-top: 1px; }
.auth-notice[hidden] { display: none; }
.auth-notice strong { color: var(--ink); }

/* Error variant, set by js/auth.js when a Supabase call fails */
.auth-notice.is-error {
  background: var(--danger-soft);
  border-color: rgba(248, 113, 113, 0.3);
}

.auth-notice.is-error svg { color: var(--danger); }

.auth-trustline {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
  font-size: var(--text-xs);
  color: var(--muted);
}

.auth-trustline svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--trust); margin-top: 1px; }

.auth-switch {
  margin-top: var(--space-5);
  font-size: var(--text-sm);
  color: var(--ink-soft);
  text-align: center;
}

.auth-switch button {
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--lumo-deep);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-switch button:hover { color: var(--ink); }

.auth-fineprint {
  margin-top: var(--space-5);
  font-size: var(--text-xs);
  color: var(--muted);
  text-align: center;
}

/* ---------- Right editorial panel ---------- */

.auth-aside { display: none; }

@media (min-width: 64rem) {
  .auth { grid-template-columns: 1.05fr 0.95fr; }

  .auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-6);
    padding: var(--space-8) clamp(var(--space-6), 4vw, var(--space-8));
    background: var(--night);
    color: var(--ink-on-night);
    overflow: hidden;
  }

  .auth-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
      radial-gradient(60rem 30rem at 76% -6rem, rgba(79, 141, 255, 0.34), transparent 60%),
      radial-gradient(40rem 26rem at 20% 108%, rgba(79, 141, 255, 0.12), transparent 62%);
  }

  .auth-aside > * { position: relative; }
}

.auth-aside .eyebrow { color: var(--lumo-bright); }

.auth-aside blockquote {
  font-family: var(--font-display);
  font-weight: 460;
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  letter-spacing: -0.01em;
  max-width: 22ch;
}

.trust-list { list-style: none; display: grid; gap: var(--space-5); }

.trust-list li { display: flex; gap: 0.85rem; align-items: flex-start; }

.trust-list svg {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: var(--lumo-bright);
  margin-top: 2px;
}

.trust-list h3 {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--ink-on-night);
  margin-bottom: 0.15rem;
  letter-spacing: 0;
}

.trust-list p {
  font-size: var(--text-sm);
  color: var(--muted-on-night);
  max-width: 34ch;
}

.aside-foot {
  font-size: var(--text-xs);
  color: var(--muted-on-night);
  border-top: 1px solid var(--line-on-night);
  padding-top: var(--space-5);
}

.aside-foot .mono { color: var(--ink-on-night); }

/* ---------- Footer ---------- */

.site-footer { padding-block: var(--space-6); }
.site-footer .footer-disclaimer,
.site-footer .footer-legal {
  font-size: var(--text-xs);
  color: var(--muted-on-night);
  max-width: 62ch;
}
.site-footer .footer-legal { margin-top: var(--space-3); }

/* ---------- Google sign-in ---------- */
.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted-on-night, #98a2b3);
  font-size: 13px;
}
.auth-or::before, .auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-on-night, rgba(255,255,255,0.12));
}
.auth-google { width: 100%; }
