/* Auth pages — login, register, verify, reset, forgot.
   Builds on the Remix design tokens (see lx-theme-remix.css). The body
   sets up the ambient bg-waves + warm glow; this file centres the auth
   card and adds the form-specific bits (errors, success, secondary CTA,
   field rows, layout glue). */

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

html, body {
  height: 100%;
  background: var(--ink-0);
  color: var(--fg-0);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }

/* === Page shell === */

body.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  position: relative;
}

/* Ambient layers — mirrors lx-theme-remix.css body::before/::after so
   the auth pages get the same gold-veined obsidian backdrop as the rest
   of the app. */
body.auth::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url('/assets/img/bg-waves.svg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  mix-blend-mode: screen;
  opacity: 0.55;
}

body.auth::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(oklch(1 0 0 / 0.018) 1px, transparent 1px) 0 0 / 22px 22px,
    radial-gradient(700px 500px at 95% 10%, oklch(0.78 0.15 75 / 0.22), transparent 60%),
    radial-gradient(800px 600px at 5% 95%, oklch(0.70 0.13 70 / 0.18), transparent 60%),
    radial-gradient(700px 400px at 0% -5%, oklch(0.85 0.13 75 / 0.14), transparent 55%),
    radial-gradient(140% 90% at 50% 50%, transparent 35%, oklch(0.06 0.004 60 / 0.7) 100%);
}

/* === Card === */

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: 32px 32px 28px;
  background:
    linear-gradient(180deg, oklch(1 0 0 / 0.025), oklch(1 0 0 / 0.005)),
    var(--ink-1);
  border: 1px solid var(--ink-3);
  border-radius: var(--r-lg);
  box-shadow:
    0 1px 0 oklch(1 0 0 / 0.04) inset,
    0 24px 60px -20px oklch(0 0 0 / 0.65),
    0 0 0 1px oklch(0.85 0.13 75 / 0.06);
}

/* Faint gold top rim — matches the sidebar rim in lx-theme-remix.css */
.auth-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(to right,
    transparent,
    oklch(0.85 0.13 75 / 0.55),
    transparent);
  pointer-events: none;
}

/* === Brand mark === */

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.auth-brand img {
  height: 36px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 12px oklch(0.85 0.13 75 / 0.45));
}

.auth-brand .wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: oklch(0.82 0.12 75);
  text-shadow: 0 1px 6px oklch(0.85 0.13 75 / 0.25);
}

.auth-brand .wordmark em {
  font-style: normal;
  font-weight: 400;
}

.auth-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass-1);
  margin-top: 16px;
  margin-bottom: 6px;
}

.auth-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--fg-0);
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 13.5px;
  color: var(--fg-2);
  line-height: 1.55;
  margin-bottom: 22px;
}

/* === Fields === */

.auth-field { margin-top: 16px; }
.auth-field:first-of-type { margin-top: 0; }

.auth-card label.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 8px;
}

.auth-card label.field-label .hint {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--fg-3);
  text-transform: none;
}

.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"] {
  width: 100%;
  background: var(--ink-0);
  border: 1px solid var(--ink-3);
  border-radius: var(--r-md);
  padding: 11px 13px;
  font-size: 14px;
  color: var(--fg-0);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-card input:focus {
  border-color: var(--brass-2);
  box-shadow: 0 0 0 3px oklch(0.84 0.12 75 / 0.12);
}

.auth-card input::placeholder { color: var(--fg-3); }

/* === Checkbox row === */

.auth-card .checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--fg-1);
  line-height: 1.5;
  cursor: pointer;
}

.auth-card .checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--brass-1);
  cursor: pointer;
  flex-shrink: 0;
}

.auth-card .checkbox-row a {
  color: var(--brass-1);
  text-decoration: none;
}
.auth-card .checkbox-row a:hover { text-decoration: underline; }

/* === Primary CTA (brass) === */

.auth-btn {
  width: 100%;
  margin-top: 22px;
  padding: 13px 18px;
  background: linear-gradient(140deg, var(--brass-0), var(--brass-1) 50%, var(--brass-2));
  color: oklch(0.15 0.01 60);
  border: 1px solid oklch(0.92 0.07 85 / 0.5);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: var(--shadow-brass);
  transition: filter 0.15s, transform 0.1s;
}

.auth-btn:hover:not(:disabled) { filter: brightness(1.08); }
.auth-btn:active:not(:disabled) { transform: translateY(1px); }
.auth-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* === Secondary CTA (outline) === */

.auth-btn-secondary {
  background: transparent;
  border: 1px solid var(--ink-4);
  color: var(--fg-0);
  box-shadow: none;
  margin-top: 12px;
  font-weight: 500;
}

.auth-btn-secondary:hover:not(:disabled) {
  background: oklch(1 0 0 / 0.02);
  border-color: var(--brass-3);
  color: var(--brass-1);
  filter: none;
}

/* === Status messages === */

.auth-error,
.auth-success,
.auth-warn {
  margin-top: 16px;
  padding: 11px 13px;
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.5;
  display: none;
}
.auth-error.show,
.auth-success.show,
.auth-warn.show { display: block; }

.auth-error {
  background: oklch(0.70 0.15 25 / 0.10);
  border: 1px solid oklch(0.70 0.15 25 / 0.35);
  color: oklch(0.85 0.10 25);
}

.auth-success {
  background: var(--brass-tint);
  border: 1px solid oklch(0.84 0.12 75 / 0.35);
  color: var(--brass-0);
}

.auth-warn {
  background: oklch(0.78 0.12 80 / 0.08);
  border: 1px solid oklch(0.78 0.12 80 / 0.35);
  color: oklch(0.88 0.08 80);
}

/* === Footer links === */

.auth-links {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--ink-3);
  font-size: 12.5px;
  color: var(--fg-2);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.auth-links a {
  color: var(--brass-1);
  text-decoration: none;
  transition: color 0.15s;
}
.auth-links a:hover { color: var(--brass-0); text-decoration: underline; }

/* === OAuth: Whop divider + button === */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 14px;
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
.auth-divider span:first-child,
.auth-divider span:last-child {
  flex: 1;
  height: 1px;
  background: var(--ink-3);
}

.whop-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: #fa6919;
  color: #fff;
  border: 1px solid oklch(0.65 0.18 50 / 0.55);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 16px -8px oklch(0.65 0.20 50 / 0.55);
  transition: filter 0.15s, box-shadow 0.15s, transform 0.1s;
}
.whop-btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 8px 24px -8px oklch(0.65 0.20 50 / 0.65);
}
.whop-btn:active { transform: translateY(1px); }
.whop-btn .whop-mark {
  height: 16px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

/* Verify page — multiple states need their own action button block */
.auth-actions { margin-top: 6px; }
.auth-actions .auth-btn { margin-top: 4px; }
.auth-actions .auth-btn + .auth-btn { margin-top: 10px; }

/* Reset page — link-style button when a request is needed */
#missing-token { margin-top: 8px; }

/* Terms page (kept for legacy /legal/terms which still uses auth.css) */
.auth-terms {
  font-size: 14px;
  color: var(--fg-1);
  line-height: 1.65;
}
.auth-terms p + p { margin-top: 12px; }
.auth-terms h2 {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--fg-0);
  margin-top: 22px;
  margin-bottom: 8px;
  font-weight: 600;
}

/* === Responsive === */

@media (max-width: 480px) {
  body.auth { padding: 24px 16px; }
  .auth-card { padding: 24px 22px 22px; }
  .auth-title { font-size: 19px; }
}
