/* ---------------------------------------------------------------
   Cila waitlist landing page
   Light cool-grey background, coral/rose/amber brand accents, a
   continuous hairline grid with a roaming multi-hue glow behind a
   centred glass card.
   --------------------------------------------------------------- */

:root {
  --bg: #F1F2F5;

  --tile-rest: 35, 41, 61; /* rgb channels, alpha applied per-layer */

  --coral: #FF5C6C;
  --coral-dark: #E14B5B;
  --rose: #FF93A6;
  --amber: #F3C57E;

  --ink: #23293D;
  --ink-soft: #5D6070;
  --ink-faint: #90939F;

  --line: rgba(35, 41, 61, 0.1);
  --card-border: rgba(255, 255, 255, 0.9);

  --error: #C6425A;
  --success: #1FA98A;

  --radius-lg: 26px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow-card: 0 30px 60px -20px rgba(30, 33, 44, 0.16), 0 1px 0 rgba(255,255,255,0.6) inset;
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- Background: continuous grid + roaming glow ---------------- */

.grid-lines,
.tile-cursor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none; /* never intercepts clicks — listeners are on window */
}

/* Full-bleed, continuous hairline grid. No DOM tiles, no gaps, no corners —
   just two very faint repeating gradients. Always visible, never animated.
   Unchanged from before — only the cursor interaction below changed shape. */
.grid-lines {
  background-image:
    linear-gradient(rgba(var(--tile-rest), 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--tile-rest), 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
}

/* A tile is created the instant the trail's head first visits its grid
   cell, pinned there for its whole (short) life — it never slides to a
   new position, it only fades as script.js ages it out. The short
   transition here is just a smoothing cushion between per-frame updates. */
.tile-sq {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background-color: transparent;
  opacity: 0;
  will-change: opacity;
  transition: background-color 120ms ease-out;
}

/* ---------------- Layout ---------------- */

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
}

.card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 40px 32px 32px;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  text-align: center;
}

@supports not (backdrop-filter: blur(1px)) {
  .card { background: #FFFFFF; }
}

/* backdrop-filter is one of the most GPU-expensive properties to keep
   re-sampling behind constantly-animating content, and mobile GPUs have
   far less headroom for it than desktop. Cut it down on touch devices
   and narrow viewports, where the trail animation is also running. */
@media (pointer: coarse), (max-width: 640px) {
  .card {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

/* Entrance animation */
@media (prefers-reduced-motion: no-preference) {
  .card {
    animation: card-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------------- Brand ---------------- */

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

.brand-mark {
  height: 34px;
  width: auto;
  display: block;
}

.brand-word {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.5px;
  color: var(--coral);
  line-height: 1;
}

/* ---------------- Copy ---------------- */

.headline {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 26px;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 12px;
}

.subcopy {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 26px;
}

/* ---------------- Form ---------------- */

.form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form[hidden] {
  display: none;
}

/* Netlify honeypot: kept in the render tree (not display:none) so basic
   bots still find and fill it in, but moved off-screen for real visitors
   and hidden from assistive tech. */
.hp-field {
  position: absolute;
  left: -5000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  margin: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  padding-left: 2px;
}

.field input,
.field select {
  height: 48px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--line);
  background: #FFFFFF;
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  padding: 0 14px;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder {
  color: var(--ink-faint);
}

.field input:focus-visible,
.field select:focus-visible {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 4px rgba(255, 92, 108, 0.14);
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--ink-faint);
  border-bottom: 1.5px solid var(--ink-faint);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 38px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field select:invalid {
  color: var(--ink-faint);
}

/* Invalid state, applied by JS after a failed submit attempt */
.field.invalid input,
.field.invalid select {
  border-color: var(--error);
}
.field.invalid input:focus-visible,
.field.invalid select:focus-visible {
  box-shadow: 0 0 0 4px rgba(198, 66, 90, 0.14);
}

.field-error {
  min-height: 16px;
  margin: 0;
  padding-left: 2px;
  font-size: 12px;
  color: var(--error);
  font-weight: 500;
}

.cta {
  height: 50px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--coral);
  color: #2A0B0F;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.cta:hover { background: var(--coral-dark); }
.cta:active { transform: scale(0.98); }
.cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 92, 108, 0.28);
}

.form-status {
  min-height: 16px;
  margin: 0;
  font-size: 12.5px;
  color: var(--error);
  text-align: center;
  font-weight: 500;
}

/* ---------------- Success state ---------------- */

.success {
  padding: 12px 0 4px;
}

.success-check {
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(31, 169, 138, 0.14);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
}

.success-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ink);
}

.success-copy {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0;
}

/* ---------------- Privacy line ---------------- */

.privacy {
  margin: 22px 0 0;
  font-size: 12px;
  color: var(--ink-faint);
}

/* ---------------- Responsive ---------------- */

@media (max-width: 380px) {
  .card { padding: 32px 22px 26px; }
  .headline { font-size: 23px; }
}

@media (min-width: 700px) {
  .card { max-width: 480px; padding: 48px 44px 38px; }
  .headline { font-size: 29px; }
}
