/* ============================================================================
   PROPER × Santa Musica — uxu tokens ported to vanilla CSS.
   Dark-first, near-black, monochrome + one cool violet accent, hairlines.
   ============================================================================ */

:root {
  /* Surfaces */
  --background: oklch(0.13 0 0); /* ~#0b0b0c */
  --card: oklch(0.165 0 0);
  --foreground: oklch(0.97 0 0);
  --muted-foreground: oklch(0.62 0 0);

  /* Hairlines */
  --border: oklch(1 0 0 / 9%);
  --input-border: oklch(1 0 0 / 12%);
  --grid-line: oklch(1 0 0 / 4%);

  /* The one accent — a cool violet. RGB triplet composes into any alpha. */
  --glow-rgb: 130 130 245;
  --glow: rgb(var(--glow-rgb)); /* MUST be a real property (uxu lesson) */
  --accent-glow: rgb(var(--glow-rgb) / 0.16);

  --radius: 14px;
  --grid-size: 32px;

  --font-sans: "Geist Variable", system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono Variable", ui-monospace, "SFMono-Regular", monospace;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  min-height: 100svh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
}

/* ----------------------------------------------------------------------------
   Background layers
   ---------------------------------------------------------------------------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

/* Ambient top glow */
.bg__glow {
  position: absolute;
  top: -30vh;
  left: 50%;
  width: 90vw;
  height: 70vh;
  transform: translateX(-50%);
  background: radial-gradient(
    50% 50% at 50% 50%,
    var(--accent-glow) 0%,
    transparent 70%
  );
  filter: blur(8px);
  opacity: 0.7;
}

/* Faint structural grid */
.bg__grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  mask-image: radial-gradient(70% 60% at 50% 40%, #000 0%, transparent 100%);
}

/* Cursor-tracking spotlight */
.bg__spotlight {
  position: absolute;
  inset: 0;
  --mx: 50%;
  --my: 30%;
  background: radial-gradient(
    600px 600px at var(--mx) var(--my),
    var(--accent-glow) 0%,
    transparent 65%
  );
  transition: background-position 0.1s linear;
}

/* Monochrome film grain */
.bg__grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
}

/* ----------------------------------------------------------------------------
   Card
   ---------------------------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: 460px;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px 24px;
  box-shadow:
    0 1px 0 0 oklch(1 0 0 / 6%) inset,
    0 40px 80px -40px rgb(0 0 0 / 0.7);
}

.card__head {
  text-align: center;
  margin-bottom: 28px;
}

.logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 22px;
}

/* Logos are white PNGs on transparent bg; sized by height, width auto. */
.logo {
  display: block;
  width: auto;
  opacity: 0.95;
}

.logo--proper {
  height: 16px;
}

.logo--santa {
  height: 50px;
}

.logo__x {
  font-family: var(--font-mono);
  color: var(--muted-foreground);
  font-size: 12px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--glow);
  margin: 0 0 8px;
}

.title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.subline {
  color: var(--muted-foreground);
  font-size: 14px;
  margin: 0 auto;
  max-width: 34ch;
}

/* ----------------------------------------------------------------------------
   Form
   ---------------------------------------------------------------------------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  padding: 0;
  display: block;
  margin-bottom: 8px;
}

.choices {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Choice cards */
.choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease;
}

.choice:hover {
  border-color: oklch(1 0 0 / 16%);
}

.choice__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.choice__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.choice__name {
  font-size: 15px;
  font-weight: 550;
  letter-spacing: -0.01em;
}

.choice__desc {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-foreground);
  letter-spacing: 0.01em;
}

/* Custom checkbox mark */
.choice__mark {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  position: relative;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease;
}

.choice__mark::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--background);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s ease;
}

/* Selected state — lights with the accent */
.choice:has(.choice__input:checked) {
  border-color: rgb(var(--glow-rgb) / 0.6);
  background: rgb(var(--glow-rgb) / 0.08);
  box-shadow: 0 0 0 1px rgb(var(--glow-rgb) / 0.25);
}

.choice:has(.choice__input:checked) .choice__mark {
  background: var(--glow);
  border-color: var(--glow);
}

.choice:has(.choice__input:checked) .choice__mark::after {
  transform: rotate(45deg) scale(1);
}

/* Keyboard focus */
.choice__input:focus-visible + .choice__body {
  outline: none;
}
.choice:has(.choice__input:focus-visible) {
  border-color: var(--glow);
  box-shadow: 0 0 0 3px rgb(var(--glow-rgb) / 0.3);
}

/* ----------------------------------------------------------------------------
   Email reveal
   ---------------------------------------------------------------------------- */
.email {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.28s ease,
    opacity 0.28s ease;
}

.email[data-open="true"] {
  grid-template-rows: 1fr;
  opacity: 1;
}

.email__inner {
  overflow: hidden;
  min-height: 0;
}

.input {
  width: 100%;
  background: oklch(1 0 0 / 3%);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 13px 14px;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.input::placeholder {
  color: oklch(1 0 0 / 28%);
}

.input:focus {
  outline: none;
  border-color: var(--glow);
  box-shadow: 0 0 0 3px rgb(var(--glow-rgb) / 0.25);
}

.input[aria-invalid="true"] {
  border-color: oklch(0.704 0.191 22.216);
}

.error {
  font-family: var(--font-mono);
  font-size: 11px;
  color: oklch(0.74 0.16 22);
  margin: 8px 0 0;
  min-height: 1em;
}

/* ----------------------------------------------------------------------------
   Submit + status
   ---------------------------------------------------------------------------- */
.btn {
  margin-top: 4px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: var(--foreground);
  color: var(--background);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 14px 16px;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    opacity 0.18s ease,
    box-shadow 0.18s ease;
}

.btn:not(:disabled):hover {
  box-shadow: 0 0 24px -6px rgb(var(--glow-rgb) / 0.5);
}

.btn:not(:disabled):active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn[data-loading="true"] {
  opacity: 0.7;
  cursor: progress;
}

.status {
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
  margin: 4px 0 0;
  min-height: 1.2em;
  color: var(--muted-foreground);
}

.status[data-tone="success"] {
  color: var(--glow);
}

.status[data-tone="error"] {
  color: oklch(0.74 0.16 22);
}

/* ----------------------------------------------------------------------------
   Footer
   ---------------------------------------------------------------------------- */
.card__foot {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
}

.foot__mono {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: oklch(1 0 0 / 35%);
  text-transform: uppercase;
}

/* ----------------------------------------------------------------------------
   Motion
   ---------------------------------------------------------------------------- */
.load-in {
  animation: load-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes load-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .bg__spotlight {
    background: radial-gradient(
      600px 600px at 50% 30%,
      var(--accent-glow) 0%,
      transparent 65%
    );
  }
}

@media (max-width: 480px) {
  .card {
    padding: 28px 22px 20px;
  }
  .title {
    font-size: 24px;
  }
}
