/**
 * QueerSpace base + auth styles — served from /public (NOT webpack chunks).
 * If you see a “themeless” page, /_next/static CSS is not loading; this file still applies.
 * Keep roughly in sync with app/globals.css (tokens + .auth-* + theme toggle).
 */

:root {
  --foreground-rgb: 19, 27, 44;
  --background-start-rgb: 238, 243, 255;
  --background-end-rgb: 249, 251, 255;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-soft: rgba(255, 255, 255, 0.55);
  --surface-border: rgba(114, 134, 179, 0.24);
  --muted: #5c6b89;
  --brand: #4f7cff;
  --brand-2: #8d6bff;
  --danger: #d84f71;
  --success: #238f67;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --foreground-rgb: 255, 255, 255;
    --background-start-rgb: 12, 17, 32;
    --background-end-rgb: 8, 12, 24;
    --surface: rgba(16, 23, 41, 0.72);
    --surface-soft: rgba(16, 23, 41, 0.54);
    --surface-border: rgba(177, 196, 230, 0.2);
    --muted: #aac0e8;
    --brand: #72a3ff;
    --brand-2: #b39dff;
    --danger: #ff8ca8;
    --success: #6be8ba;
  }
}

html[data-theme="light"] {
  --foreground-rgb: 19, 27, 44;
  --background-start-rgb: 238, 243, 255;
  --background-end-rgb: 249, 251, 255;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-soft: rgba(255, 255, 255, 0.55);
  --surface-border: rgba(114, 134, 179, 0.24);
  --muted: #5c6b89;
  --brand: #4f7cff;
  --brand-2: #8d6bff;
  --danger: #d84f71;
  --success: #238f67;
}

html[data-theme="dark"] {
  --foreground-rgb: 255, 255, 255;
  --background-start-rgb: 12, 17, 32;
  --background-end-rgb: 8, 12, 24;
  --surface: rgba(16, 23, 41, 0.72);
  --surface-soft: rgba(16, 23, 41, 0.54);
  --surface-border: rgba(177, 196, 230, 0.2);
  --muted: #aac0e8;
  --brand: #72a3ff;
  --brand-2: #b39dff;
  --danger: #ff8ca8;
  --success: #6be8ba;
}

html {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  margin: 0;
  color: rgb(var(--foreground-rgb));
  background: linear-gradient(to bottom, transparent, rgb(var(--background-end-rgb)))
    rgb(var(--background-start-rgb));
  min-height: 100vh;
}

a {
  color: inherit;
}

input,
textarea,
button {
  font: inherit;
}

.theme-toggle-btn {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background: var(--surface-soft);
  color: inherit;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(20, 31, 59, 0.08);
}

.theme-toggle-btn:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--surface-border));
}

.global-theme-toggle-slot {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 50;
  pointer-events: none;
}

.global-theme-toggle-slot .theme-toggle-btn {
  pointer-events: auto;
}

.auth-layout-root {
  min-height: 100vh;
  background: #eef3ff;
  color: #131b2c;
}

html[data-theme="dark"] .auth-layout-root {
  background: #0c1120;
  color: #f3f6ff;
}

.auth-layout-theme-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 0;
  max-width: 600px;
  margin: 0 auto;
}

.auth-theme-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.auth-fallback-theme-links {
  text-align: right;
  font-size: 13px;
  margin: 0;
  padding: 0 20px 8px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.auth-fallback-theme-links a {
  color: var(--brand);
  text-decoration: underline;
  font-weight: 600;
}

.auth-theme-hint {
  color: var(--muted);
  font-weight: 400;
}

.auth-shell {
  position: relative;
  z-index: 100;
  isolation: isolate;
  max-width: 560px;
  margin: 48px auto;
  padding: 16px;
}

.auth-card {
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgb(var(--foreground-rgb));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

html[data-theme="light"] .auth-card {
  box-shadow:
    0 4px 0 color-mix(in srgb, var(--brand) 18%, transparent),
    0 24px 56px rgba(28, 46, 96, 0.14);
}

.auth-title {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: rgb(var(--foreground-rgb));
}

@supports (-webkit-background-clip: text) {
  html[data-theme="light"] .auth-title {
    background: linear-gradient(120deg, var(--brand), var(--brand-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.auth-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.auth-label {
  display: grid;
  gap: 6px;
}

.auth-label > span {
  font-weight: 600;
}

.auth-remember {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.35;
  color: color-mix(in srgb, var(--foreground) 88%, transparent);
}

.auth-remember input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.auth-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: var(--surface-soft);
  color: inherit;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-input::placeholder {
  color: color-mix(in srgb, var(--muted) 75%, transparent);
}

.auth-input:focus {
  border-color: color-mix(in srgb, var(--brand) 70%, var(--surface-border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
  background: color-mix(in srgb, var(--surface-soft) 88%, var(--brand));
}

.auth-button {
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--surface-border));
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.auth-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.auth-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-links {
  margin-top: 14px;
}

.auth-links a {
  color: var(--brand);
  text-decoration: underline;
}
