/*
  MORTRR — registration page (/register/)
  Loaded after styles.css: reuses its variables, stage background, pills
  and keyframes. The top menu comes from css/nav.css.

  Laptop / desktop (wider than 900px): one screen, no scroll. The form sits
  in a frosted-glass card; field heights shrink a little on short screens.
  Phones / small tablets: the two columns stack and the page scrolls.

  1. Page
  2. Layout
  3. Pitch (left)
  4. Form card (right)
  5. Form
  6. Success state
  7. Responsive
*/

/* 1. Page ------------------------------------------------------------ */
.stage--register {
  height: auto;
  min-height: 100svh;
  overflow: clip;
}

/* 2. Layout ---------------------------------------------------------- */
.reg {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
  max-width: 1240px;
  margin: 0 auto;
}

/* Huge faint wordmark along the bottom */
.reg-ghost {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: -0.2em;
  translate: -50% 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: min(27vw, 46svh);
  line-height: 1;
  letter-spacing: -0.065em;
  white-space: nowrap;
  color: rgb(18 18 18 / 0.07);
  pointer-events: none;
  user-select: none;
}

/* 3. Pitch ----------------------------------------------------------- */
.reg-pitch {
  animation: rise-wordmark-soft 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.reg-eyebrow {
  margin-bottom: clamp(14px, 2.6svh, 28px);
}

.reg-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(40px, min(6.4vw, 11svh), 104px);
  line-height: 0.9;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}

.reg-hand {
  display: block;
  margin-bottom: 0.08em;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 0.6em;
  line-height: 0.9;
  letter-spacing: 0;
  text-transform: none;
  rotate: -4deg;
  transform-origin: left center;
}

.reg-chip {
  display: inline-block;
  padding: 0.04em 0.22em 0.1em;
  border-radius: 0.12em;
  background: var(--ink);
  color: var(--yellow);
  rotate: -2deg;
  box-shadow: 0 18px 30px -16px rgb(18 18 18 / 0.55);
}

.reg-lead {
  max-width: 36ch;
  margin-top: clamp(14px, 2.6svh, 30px);
  font-weight: 700;
  font-size: clamp(15px, min(1.35vw, 2.4svh), 19px);
  line-height: 1.5;
  color: rgb(18 18 18 / 0.78);
}

.reg-perks {
  display: grid;
  gap: clamp(8px, 1.4svh, 12px);
  margin-top: clamp(14px, 2.6svh, 30px);
  padding: 0;
  list-style: none;
  font-weight: 800;
  font-size: clamp(13px, min(1.15vw, 2svh), 16px);
}

.reg-perks li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reg-perk-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 2em;
  aspect-ratio: 1;
  border-radius: 30%;
  background: var(--ink);
  color: var(--yellow);
  font-family: var(--font-display);
  font-size: 0.85em;
}

/* 4. Form card ------------------------------------------------------ */
/* Frosted glass: the yellow page and the big wordmark blur through it,
   a light sheen runs across the top, and a bright rim catches the edge. */
.reg-card {
  position: relative;
  isolation: isolate;
  justify-self: center;
  width: min(100%, 440px);
  padding: clamp(22px, 3.6svh, 36px) clamp(20px, 2.6vw, 36px);
  border: 1px solid rgb(255 255 255 / 0.75);
  border-radius: 24px;
  background: linear-gradient(160deg, rgb(255 255 255 / 0.72), rgb(255 255 255 / 0.42));
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.95),
    inset 0 -1px 0 rgb(255 255 255 / 0.35),
    0 30px 60px -30px rgb(110 70 0 / 0.55),
    0 10px 24px -14px rgb(110 70 0 / 0.3);
  overflow: hidden;
  animation: rise-wordmark-soft 0.9s 0.12s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Glossy sheen across the top of the card */
.reg-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 46%;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.55), rgb(255 255 255 / 0));
  pointer-events: none;
}

/* Soft yellow glow in one corner */
.reg-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -30%;
  bottom: -30%;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 214 51 / 0.45), transparent 70%);
  pointer-events: none;
}

/* No blur support: fall back to a solid card so text stays readable */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .reg-card { background: rgb(255 255 255 / 0.94); }
}

/* 5. Form ------------------------------------------------------------ */
.reg-form {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.9svh, 16px);
}

.reg-form-head { margin-bottom: 2px; }

.reg-form-title {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.reg-form-title:focus { outline: none; }

.reg-form-sub {
  margin-top: 4px;
  font-weight: 600;
  font-size: 14px;
  color: rgb(18 18 18 / 0.55);
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-weight: 700;
  font-size: 13px;
  color: rgb(18 18 18 / 0.75);
}

.field input,
.field-tel {
  width: 100%;
  height: clamp(42px, 5.6svh, 46px);
  border: 1px solid rgb(18 18 18 / 0.1);
  border-radius: 12px;
  background: rgb(255 255 255 / 0.78);
  box-shadow: inset 0 1px 2px rgb(18 18 18 / 0.05);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.field input {
  padding: 0 14px;
  color: var(--ink);
  font: 600 16px/1 var(--font-body); /* 16px stops iOS zooming on focus */
  outline: none;
}

.field input::placeholder { color: #a5a29a; font-weight: 500; }

.field > input:hover,
.field-tel:hover { border-color: rgb(18 18 18 / 0.22); background: rgb(255 255 255 / 0.9); }

.field > input:focus,
.field-tel:focus-within {
  border-color: var(--ink);
  background: #fff;
  box-shadow: 0 0 0 4px rgb(255 210 31 / 0.6);
}

.field-tel {
  display: flex;
  align-items: center;
  overflow: hidden;
}

.field-tel input {
  height: 100%;
  border: 0;
  border-radius: 0;
  background: none;
  padding-left: 12px;
  box-shadow: none;
}

.field-prefix {
  align-self: stretch;
  display: grid;
  place-items: center;
  padding: 0 12px 0 14px;
  border-right: 1px solid rgb(18 18 18 / 0.08);
  background: rgb(255 255 255 / 0.5);
  font-weight: 700;
  font-size: 15px;
  color: rgb(18 18 18 / 0.7);
}

.field.is-invalid > input,
.field.is-invalid .field-tel {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgb(229 72 77 / 0.15);
}

.field-error,
.form-error {
  font-weight: 600;
  font-size: 13px;
  color: #c62f35;
}

.field-error:empty,
.form-error:empty { display: none; }

.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  height: clamp(46px, 6svh, 50px);
  margin-top: 4px;
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #34312a, var(--ink) 55%, #050505);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.22),
    0 12px 24px -12px rgb(18 18 18 / 0.7);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s, translate 0.15s;
}

/* Glossy highlight on the upper half, and a shine that sweeps on hover */
.btn::before {
  content: "";
  position: absolute;
  inset: 0 0 50%;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.14), rgb(255 255 255 / 0));
  pointer-events: none;
}

.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgb(255 255 255 / 0.18), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
  pointer-events: none;
}

.btn:hover::after { left: 120%; }
.btn:hover { box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.28), 0 16px 28px -12px rgb(18 18 18 / 0.75); }
.btn:active { translate: 0 1px; }

.btn:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

.btn-arrow {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--yellow);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn[aria-busy="true"] {
  cursor: progress;
  opacity: 0.85;
}

.btn[aria-busy="true"] .btn-arrow {
  border: 2.4px solid var(--yellow);
  border-right-color: transparent;
  border-radius: 50%;
  stroke: none;
  animation: spin 0.7s linear infinite;
}

.reg-note {
  font-weight: 600;
  font-size: 12.5px;
  line-height: 1.45;
  text-align: center;
  color: rgb(18 18 18 / 0.6);
}

.reg-note a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgb(18 18 18 / 0.3);
  text-underline-offset: 2px;
}

.reg-note a:hover { text-decoration-color: var(--ink); }

/* 6. Success state --------------------------------------------------- */
.reg-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 300px;
  text-align: center;
}

.reg-form[hidden],
.reg-done[hidden] { display: none; }

.reg-done-check {
  display: grid;
  place-items: center;
  width: 64px;
  aspect-ratio: 1;
  margin-bottom: 6px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--sun-light), var(--sun-dark));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.6), 0 12px 24px -10px rgb(255 170 0 / 0.7);
  animation: pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

.reg-done-check svg {
  width: 52%;
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reg-done-text {
  max-width: 28ch;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.5;
  color: rgb(18 18 18 / 0.65);
}

.reg-done-link {
  margin-top: 8px;
  padding: 10px 18px;
  border: 1px solid rgb(18 18 18 / 0.14);
  border-radius: 12px;
  background: rgb(255 255 255 / 0.6);
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}

.reg-done-link:hover { border-color: var(--ink); }

/* 7. Responsive ------------------------------------------------------ */

/* Laptop / desktop: exactly one screen, never scrolls */
@media (min-width: 901px) {
  .stage--register { height: 100svh; }

  .reg {
    height: 100svh;
    /* top clears the menu bar; no footer on this page */
    padding: clamp(92px, 13svh, 120px) clamp(24px, 5vw, 72px) clamp(20px, 4svh, 40px);
  }

  /* Short laptop screens: drop the perks list to make room */
  @media (max-height: 680px) {
    .reg-perks { display: none; }
    .reg-form-sub { display: none; }
  }
}

/* Phones / small tablets: stack, page scrolls */
@media (max-width: 900px) {
  html.scroll,
  html.scroll body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .reg {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 32px;
    padding: clamp(96px, 13svh, 116px) 16px 48px;
    text-align: center;
  }

  .reg-card { text-align: left; }
  .reg-title { font-size: clamp(42px, 12vw, 72px); }
  .reg-hand { transform-origin: center; }
  .reg-lead { margin-inline: auto; font-size: 16px; }
  .reg-perks { justify-items: center; font-size: 15px; }
  .reg-ghost { font-size: 32vw; bottom: 0.1em; }
}

@media (max-width: 420px) {
  .reg-perks { justify-items: start; text-align: left; }
}

@keyframes rise-wordmark-soft {
  from { translate: 0 24px; opacity: 0; }
  to { translate: 0 0; opacity: 1; }
}

@keyframes spin {
  to { rotate: 360deg; }
}
