/**
 * Dealnopoly: Warm Timber design language.
 *
 * Tokens mirror the Realnopoly system so the two products read as siblings.
 * LIGHT is the :root default; DARK is applied via <html class="dark">.
 * Switching the whole site is one class change in includes/head.php.
 */

/* ---------- Tokens: light ---------- */
:root {
  --radius: 0.75rem;

  --background: #fbf9f5;
  --foreground: #241c18;
  --card: #fffdfa;
  --card-foreground: #241c18;

  --primary: #863527;
  --primary-foreground: #fdfaf4;
  --primary-hover: #6f2c20;

  --secondary: #f4f0e9;
  --muted: #f4f0e9;
  --muted-foreground: #6d6059;
  --accent: #f3ebe3;

  --border: #e4dfd7;
  --input: #e4dfd7;
  --ring: #b4695a;

  --cedar: #317a45;
  --oak: #976213;
  --mahogany: #863527;

  --glow: rgba(134, 53, 39, 0.10);
  --speck: rgba(36, 28, 24, 0.06);

  /* Space Grotesk carries real personality (single-story a, squared terminals)
     without reading as a boutique serif, so the headline sounds like software
     rather than a shop. Inter for body keeps rendering identical across
     platforms instead of inheriting whatever system font the visitor has. */
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Tokens: dark ---------- */
.dark {
  --background: #120d0b;
  --foreground: #ebe7e2;
  --card: #1c1612;
  --card-foreground: #ebe7e2;

  --primary: #ce7761;
  --primary-foreground: #100a07;
  --primary-hover: #dd8a75;

  --secondary: #29221f;
  --muted: #27201d;
  --muted-foreground: #aca39b;
  --accent: #2f2722;

  --border: rgba(246, 237, 224, 0.12);
  --input: rgba(246, 237, 224, 0.16);
  --ring: #9f5d4d;

  --cedar: #63b376;
  --oak: #d9a347;
  --mahogany: #ce7761;

  --glow: rgba(206, 119, 97, 0.13);
  --speck: rgba(246, 237, 224, 0.10);
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.25rem;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

/* Warm radial wash + faint specks, echoing the Realnopoly backdrop. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 50% -10%, var(--glow), transparent 70%),
    radial-gradient(40rem 30rem at 85% 110%, var(--glow), transparent 70%);
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 42rem;
  text-align: center;
}

/* Auth and other single-column forms. A login card at full width reads as an
   empty page with a stripe across it; ~26rem keeps it feeling like a door. */
.wrap--narrow { max-width: 26rem; }

/* ---------- Brand ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2.5rem;
  text-decoration: none;
  color: inherit;
}

.brand__mark {
  width: 2.4rem;
  height: 2.4rem;
  flex: none;
  color: var(--primary);
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
}

/* ---------- Eyebrow ---------- */
.eyebrow {
  margin: 0 0 1.1rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

/* ---------- Headline ---------- */
h1 {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.35rem, 7vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

h1 .accent {
  display: block;
  color: var(--primary);
}

.lede {
  margin: 0 auto 2rem;
  max-width: 34rem;
  color: var(--muted-foreground);
  font-size: 1.0625rem;
}

/* ---------- Capability dots ---------- */
.pillars {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.5rem;
  margin: 0 0 2.25rem;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
}

.pillars li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-foreground);
}

.pillars li::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

.pillars .is-cedar { color: var(--cedar); }
.pillars .is-oak { color: var(--oak); }
.pillars .is-mahogany { color: var(--mahogany); }

/* ---------- Forms ---------- */
/* Notify row, dimensioned to match the Realnopoly reference exactly:
   512px container, 12px gap, 54px control height, 16px radius, 14px type.
   The input flexes to fill (364px at that container width) and the button
   sits at its natural ~136px. */
.form-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 32rem;
  margin: 0 auto;
}

.form-row .field { flex: 1 1 15rem; }

.form-row input[type="email"],
.form-row .btn {
  height: 54px;
  border-radius: 1rem;
  font-size: 0.875rem;
}

.form-row input[type="email"] { padding: 1rem 1.25rem; }

.form-row .btn {
  padding: 1rem 1.5rem;
  font-weight: 500;
}

.field {
  flex: 1 1 18rem;
  min-width: 0;
  text-align: left;
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 0.9rem 1.05rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder { color: var(--muted-foreground); opacity: 0.85; }

input:focus-visible {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 28%, transparent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-foreground);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, transform 0.05s ease;
}

.btn:hover { background: var(--primary-hover); }
.btn:active { transform: translateY(1px); }

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 45%, transparent);
}

.btn--block { width: 100%; }

.microcopy {
  margin: 0.9rem 0 0;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

/* ---------- Notices ---------- */
.notice {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  background: var(--card);
  font-size: 0.92rem;
  text-align: left;
}

.notice--ok { border-left-color: var(--cedar); }
.notice--error { border-left-color: var(--oak); }

/* ---------- Card (login) ---------- */
.card {
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 0.25rem);
  background: var(--card);
  text-align: left;
}

.card h1 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  margin-bottom: 0.4rem;
  text-align: center;
}

.card .lede { text-align: center; margin-bottom: 1.75rem; font-size: 1rem; }

.stack { display: grid; gap: 1.1rem; }

.field-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}

.link:hover { text-decoration: underline; }

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted-foreground);
  cursor: pointer;
}

/* Custom checkbox: the native control renders as a bright white square on the
   dark card, which reads as a rendering bug rather than a control. */
.checkbox input {
  appearance: none;
  -webkit-appearance: none;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  flex: none;
  border: 1px solid var(--input);
  border-radius: 0.3rem;
  background: var(--background);
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.checkbox input::after {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  transform: scale(0);
  transition: transform 0.12s ease-in-out;
  background: var(--primary-foreground);
  clip-path: polygon(14% 44%, 0 65%, 39% 100%, 100% 16%, 84% 0, 39% 62%);
}

.checkbox input:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox input:checked::after { transform: scale(1); }

.checkbox input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 35%, transparent);
}

/* ---------- Footer link ---------- */
.footer-link {
  margin-top: 2.5rem;
  font-size: 0.9rem;
  color: var(--muted-foreground);
}

.footer-link a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
}

.footer-link a:hover { color: var(--foreground); border-color: var(--primary); }

/* ---------- Accessibility ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
