/* DV62 AURORA SIGN-UP · Stage 3 of 4 adds the sky canvas over the photo; the frost below stays as the no-WebGL fallback.
   Dark page only: the theme never follows the OS. */
:root {
  --ink: #ffffff;
  --ink-soft: rgba(236, 252, 246, .95);
  --glow: 150, 245, 195;          /* aurora green (field glow, board 119,204,162 brightened) */
  --glow-deep: 70, 230, 150;
  --rose: 255, 120, 165;          /* the aurora's rose fringe: errors */
  --field: rgba(6, 22, 22, .44);
  --field-focus: rgba(6, 30, 26, .52);
  --btn-ink: #1f2b2b;
  --violet-ink: #2a2148;
  --r-card: 18px;
  --r-field: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: #061418; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh; min-height: 100svh; color: var(--ink); background: #061418;
  font-family: Montserrat, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; font-weight: 500;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden;
}
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------ backdrop: the real photo (also the no-WebGL look and first paint) */
.backdrop {
  position: fixed; inset: 0; z-index: 0;
  background: #061418 url(img/aurora_1376.webp) 50% 45% / cover no-repeat;
}
.backdrop::after {   /* the same night grade + vignette the shader applies, roughly */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(4, 26, 34, .5) 62%, rgba(4, 20, 28, .62)),
              radial-gradient(ellipse 80% 75% at 50% 48%, transparent 55%, rgba(0, 6, 10, .5));
}
.sky { position: fixed; inset: 0; z-index: 1; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .7s ease; }
.is-gl .sky { opacity: 1; }

/* ------------------------------------------------ layout */
.stage {
  position: relative; z-index: 2; min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center; padding: 40px 16px;
}
.card {
  position: relative; display: grid; width: min(560px, max(400px, 38vw));
  padding: clamp(44px, 4.6vw, 66px) clamp(28px, 4.3vw, 62px) clamp(42px, 4.2vw, 60px);
  border-radius: var(--r-card);
}
.card > .form, .card > .done { grid-area: 1 / 1; }
/* CSS frost: before WebGL is up, and the fallback when it is not available */
html:not(.is-gl) .card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(200, 255, 235, .05) 60%, rgba(10, 40, 40, .12));
  -webkit-backdrop-filter: blur(26px) saturate(1.35) brightness(.86); backdrop-filter: blur(26px) saturate(1.35) brightness(.86);
  border: 1px solid rgba(190, 255, 225, .3);
  box-shadow: 0 30px 70px rgba(0, 8, 12, .45), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.title {
  margin: 0 0 clamp(26px, 2.6vw, 36px); text-align: center; text-transform: uppercase;
  font-weight: 600; font-size: clamp(27px, 2.62vw, 39px); line-height: 1.13; letter-spacing: .005em;
  text-shadow: 0 2px 22px rgba(0, 20, 20, .35); text-wrap: balance;
}
.title .br { display: block; white-space: nowrap; }

/* ------------------------------------------------ fields */
.field label {
  display: block; margin: 0 0 9px 1px; text-transform: uppercase;
  font-weight: 700; font-size: 13.5px; letter-spacing: .06em; color: var(--ink-soft);
  text-shadow: 0 1px 10px rgba(0, 18, 16, .55);
}
.control { position: relative; }
.control::after {            /* the glow ring: composited opacity only */
  content: ""; position: absolute; inset: 0; border-radius: var(--r-field); pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 1px rgba(var(--glow), .95), 0 0 0 2px rgba(var(--glow), .28), 0 0 24px rgba(var(--glow-deep), .5), inset 0 0 16px rgba(var(--glow-deep), .2);
  transition: opacity .3s var(--ease);
}
input {
  display: block; width: 100%; height: 52px; margin: 0; padding: 0 44px 0 16px; appearance: none;
  border-radius: var(--r-field); border: 1px solid rgba(200, 255, 230, .17); background: var(--field);
  color: #fff; font-weight: 500; font-size: 16px; line-height: 1.2; font-family: inherit; letter-spacing: .01em; outline: none;
  transition: border-color .25s var(--ease), background-color .25s var(--ease);
  caret-color: rgb(var(--glow));
}
.has-reveal input { padding-right: 92px; }
input::placeholder { color: rgba(225, 245, 238, .5); text-transform: uppercase; letter-spacing: .05em; font-size: 14.5px; opacity: 1; }
input:-webkit-autofill, input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff; transition: background-color 99999s 0s; caret-color: rgb(var(--glow));
  -webkit-box-shadow: 0 0 0 40px rgba(8, 30, 28, .9) inset;
}
.field.is-focus input { border-color: rgba(var(--glow), .9); background: var(--field-focus); }
.field.is-focus .control::after { opacity: 1; }
.field.is-invite .control::after { animation: invite 3.6s ease-in-out infinite; }
.field.is-invite input { border-color: rgba(var(--glow), .62); }
@keyframes invite { 0%, 100% { opacity: .5; } 50% { opacity: .85; } }
.field.is-error input { border-color: rgba(var(--rose), .9); }
.field.is-error .control::after {
  opacity: .9; animation: none;
  box-shadow: 0 0 0 1px rgba(var(--rose), .9), 0 0 0 2px rgba(var(--rose), .25), 0 0 24px rgba(var(--rose), .42), inset 0 0 16px rgba(var(--rose), .16);
}
.field.is-error.is-focus .control::after { opacity: 1; }

.ok {
  position: absolute; right: 15px; top: 50%; width: 20px; height: 20px; margin-top: -10px; pointer-events: none;
  fill: none; stroke: rgb(var(--glow)); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 22; stroke-dashoffset: 22; opacity: 0; transition: stroke-dashoffset .45s var(--ease), opacity .2s;
  filter: drop-shadow(0 0 6px rgba(var(--glow-deep), .7));
}
.has-reveal .ok { right: 56px; }
.field.is-valid .ok { stroke-dashoffset: 0; opacity: 1; }

.reveal {
  position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px;
  display: grid; place-items: center; background: transparent; color: rgba(230, 250, 244, .72); cursor: pointer;
  transition: color .2s, background-color .2s;
}
.reveal:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.reveal:focus-visible { outline: 2px solid rgb(var(--glow)); outline-offset: -2px; }
.eye { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.eye .slash { stroke-dasharray: 23; stroke-dashoffset: 23; transition: stroke-dashoffset .25s var(--ease); }
.reveal[aria-pressed="true"] .slash { stroke-dashoffset: 0; }

.msg {
  min-height: 19px; margin: 7px 2px 10px; font-size: 12.5px; line-height: 1.4; font-weight: 500; letter-spacing: .01em;
  color: rgba(222, 242, 236, .72);
}
.field.is-error .msg { color: #ffd2df; }
.msg .tick { color: rgb(var(--glow)); }

/* ------------------------------------------------ error summary (after a failed submit) */
.summary {
  margin: 0 0 18px; padding: 11px 14px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45;
  background: rgba(var(--rose), .12); border: 1px solid rgba(var(--rose), .38); color: #ffe3eb;
}
.summary:focus { outline: none; }
.summary:focus-visible { outline: 2px solid rgba(var(--rose), .9); outline-offset: 2px; }
.summary-title { margin: 0 0 3px; font-weight: 600; }
.summary-list { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 2px 14px; }
.summary-list a { color: #fff; text-underline-offset: 3px; text-decoration-color: rgba(var(--rose), .8); display: inline-block; padding: 2px 0; }
.summary-list a:focus-visible { outline: 2px solid rgb(var(--glow)); outline-offset: 2px; border-radius: 3px; }

/* ------------------------------------------------ the white pill */
.submit {
  position: relative; display: grid; place-items: center; width: 100%; height: 52px; margin: 2px 0 0; padding: 0 20px;
  border: 0; border-radius: 12px; cursor: pointer; overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #e9edf2); color: var(--btn-ink);
  font-weight: 600; font-size: 15.5px; line-height: 1; font-family: inherit; letter-spacing: .08em; text-transform: uppercase;
  box-shadow: 0 12px 30px rgba(0, 10, 14, .28), inset 0 -1px 0 rgba(0, 0, 0, .08), inset 0 1px 0 #fff;
  transition: transform .2s var(--ease), box-shadow .3s var(--ease);
}
.submit::before {           /* a soft light that runs through the pill on hover / while busy */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(120, 240, 180, .35) 45%, rgba(170, 140, 255, .32) 55%, transparent 70%);
  transform: translateX(-100%); transition: opacity .3s;
}
.submit > * { grid-area: 1 / 1; }
.submit:hover { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(0, 10, 14, .32), 0 0 30px rgba(var(--glow-deep), .32), inset 0 -1px 0 rgba(0, 0, 0, .08), inset 0 1px 0 #fff; }
.submit:hover::before { opacity: 1; animation: sheen 1.4s var(--ease) 1; }
.submit:active { transform: translateY(0) scale(.99); }
.submit:focus-visible { outline: 2px solid rgb(var(--glow)); outline-offset: 3px; }
.submit .busy { display: flex; gap: 6px; opacity: 0; }
.submit .busy i { width: 7px; height: 7px; border-radius: 50%; background: #2c3c3c; animation: dot 1s ease-in-out infinite; }
.submit .busy i:nth-child(2) { animation-delay: .15s; } .submit .busy i:nth-child(3) { animation-delay: .3s; }
.submit[aria-busy="true"] { cursor: progress; }
.submit[aria-busy="true"] .label { opacity: 0; }
.submit[aria-busy="true"] .busy { opacity: 1; }
.submit[aria-busy="true"]::before { opacity: 1; animation: sheen 1.1s linear infinite; }
@keyframes sheen { to { transform: translateX(100%); } }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: .45; } 50% { transform: translateY(-4px); opacity: 1; } }

/* ------------------------------------------------ success */
.form, .done { transition: opacity .45s var(--ease), transform .45s var(--ease), visibility 0s linear 0s; }
.done {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  color: var(--violet-ink); opacity: 0; visibility: hidden; transform: scale(.96);
}
.done[hidden] { display: flex; }
.is-success .form { opacity: 0; visibility: hidden; transform: scale(.97); transition-duration: .22s, .45s, 0s; transition-delay: 0s, 0s, .3s; }
.is-success .done { opacity: 1; visibility: visible; transform: none; transition-delay: .55s, .55s, 0s; }
.done-kicker { margin: 0 0 10px; font-size: 12.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #5b4f93; }
.done-title {
  margin: 0; font-weight: 700; font-size: clamp(36px, 3.6vw, 52px); line-height: 1.05; letter-spacing: .02em; text-transform: uppercase;
  color: var(--violet-ink); text-shadow: 0 0 30px rgba(255, 255, 255, .8);
}
.done-title:focus { outline: none; }
.done-text { margin: 16px 0 6px; font-size: 16px; font-weight: 600; color: #352d5c; }
.done-note { margin: 0 0 26px; font-size: 13.5px; line-height: 1.5; color: #4a4273; max-width: 30ch; overflow-wrap: anywhere; }
.done-note b { font-weight: 700; color: #2e2654; }
.again {
  height: 46px; min-width: 150px; padding: 0 24px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(60, 40, 130, .28); background: rgba(255, 255, 255, .42); color: var(--violet-ink);
  font-weight: 600; font-size: 13.5px; line-height: 1; font-family: inherit; letter-spacing: .08em; text-transform: uppercase;
  box-shadow: 0 8px 22px rgba(70, 40, 150, .16); transition: background-color .2s, transform .2s var(--ease);
}
.again:hover { background: rgba(255, 255, 255, .7); transform: translateY(-1px); }
.again:focus-visible { outline: 2px solid #6b4fe0; outline-offset: 3px; }
html:not(.is-gl).is-success .card {
  background: radial-gradient(ellipse at 50% 50%, #ffffff 0%, #ece7ff 45%, #cbbcf6 100%);
  box-shadow: 0 0 80px rgba(170, 140, 255, .65), 0 0 200px rgba(150, 110, 255, .35);
}

.credit {
  position: fixed; z-index: 2; right: 14px; bottom: 10px; margin: 0; font-size: 10.5px; letter-spacing: .02em;
  color: rgba(225, 240, 236, .5); pointer-events: none;
}

/* portrait tablets: a wider card; very large screens: the whole card scales up (zoom keeps text vector-sharp) */
@media (min-width: 561px) and (orientation: portrait) { .card { width: min(560px, 70vw); } }
@media (min-width: 1800px) and (min-height: 1000px) { .card { zoom: 1.2; } }
@media (min-width: 2300px) and (min-height: 1300px) { .card { zoom: 1.45; } }

/* ------------------------------------------------ phone: the form floats on the aurora, soft frost behind it only */
@media (max-width: 560px) {
  .stage { place-items: center; padding: 28px 16px 12vh; padding-bottom: max(12vh, 60px); }
  .card { width: 100%; padding: 30px 15px 26px; }
  html:not(.is-gl) .card { border-color: transparent; box-shadow: none; background: rgba(6, 30, 30, .22); }
  .title { font-size: clamp(25px, 7.6vw, 31px); margin-bottom: 30px; }
  .field label { text-shadow: 0 1px 12px rgba(0, 16, 14, .75), 0 0 2px rgba(0, 16, 14, .5); }
  .credit { left: 0; right: 0; text-align: center; bottom: 8px; }
}
/* short landscape screens: title left, form right */
@media (max-height: 540px) and (min-width: 600px) {
  .stage { padding: 20px 20px; }
  .card { width: min(820px, 94vw); padding: 28px 30px 24px; }
  .form { display: grid; grid-template-columns: 1fr 1.3fr; column-gap: 34px; align-items: start; }
  .form > * { grid-column: 2; }
  .form > .title { grid-column: 1; grid-row: 1 / span 4; align-self: center; text-align: left; font-size: clamp(24px, 3.2vw, 32px); margin: 0; }
  .msg { margin-bottom: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0s !important; }
  .field.is-invite .control::after { opacity: .7; }
}
