/* AE purple members-gate wall, with an optional Summer Sale lockup (shown only
   when the URL carries ?sale=). Design tokens: accent #8478A8 (light #A99FC6,
   dark #756A94). */

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

/* [hidden] must win over the display set on .field / .banner / .cta / .sale. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #17161a;
  font-family: "Inter", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- backdrop: blurred placeholder art ---------- */
.backdrop {
  position: fixed;
  inset: -18%;
  filter: blur(88px) saturate(0.72) brightness(0.8);
  transform: scale(1.06);
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.blob { position: absolute; border-radius: 50%; }
.blob-a { left: 4%; top: 2%; width: 46vw; height: 46vw; background: #6e6390; }
.blob-b { right: 2%; top: -6%; width: 40vw; height: 40vw; background: #3c4a5e; }
.blob-c { left: 26%; bottom: -14%; width: 52vw; height: 52vw; background: #8478a8; opacity: 0.75; }
.blob-d { right: 12%; bottom: -6%; width: 34vw; height: 34vw; background: #4a4152; }
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(23, 22, 26, 0.55), rgba(23, 22, 26, 0.9));
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(28, 27, 30, 0.62);
  pointer-events: none;
  transition: opacity 0.6s ease;
}

/* ---------- layout ---------- */
.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  transition: opacity 0.5s ease;
}

.card {
  position: relative;
  width: 440px;
  max-width: 100%;
  background: rgba(30, 29, 33, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(22px) saturate(1.1);
  backdrop-filter: blur(22px) saturate(1.1);
  padding: 40px 40px 34px;
  overflow: hidden;
  animation: cardIn 0.55s cubic-bezier(0.22, 0.9, 0.28, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

/* thin sale ribbon along the card's top edge */
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(169, 159, 198, 0) 0%, #a99fc6 26%, #e6dff3 50%, #a99fc6 74%, rgba(169, 159, 198, 0) 100%);
}

/* soft purple glow behind the sale lockup, only in sale mode */
.card::after {
  content: "";
  position: absolute;
  top: -120px; left: 50%;
  width: 340px; height: 240px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(132, 120, 168, 0.42), rgba(132, 120, 168, 0));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
body.sale .card::after { opacity: 1; }

.card > * { position: relative; z-index: 1; }

/* ---------- sale lockup ---------- */
.sale { text-align: center; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 13px 0 11px;
  border-radius: 999px;
  background: rgba(132, 120, 168, 0.2);
  border: 1px solid rgba(169, 159, 198, 0.42);
  color: #d7cfea;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.badge .dot {
  width: 5px; height: 5px;
  border-radius: 999px;
  background: #c4b8e4;
  box-shadow: 0 0 8px rgba(196, 184, 228, 0.9);
}

.sale-headline {
  margin: 16px 0 0;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: #ffffff;
}

.sale-sub {
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.62);
}

.code {
  display: inline-block;
  margin-top: 14px;
  padding: 7px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed rgba(169, 159, 198, 0.45);
  color: #e7e1f4;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
}
.code span {
  color: rgba(255, 255, 255, 0.46);
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-right: 8px;
}

.rule {
  height: 1px;
  margin: 26px 0 24px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.14) 50%, rgba(255, 255, 255, 0) 100%);
}

/* ---------- heading (managed per mode by gate.js) ---------- */
.head { margin-bottom: 22px; }

#title {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #ffffff;
}
#subtitle {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.62);
}
/* In sale mode the big headline is the sale, so the form heading shrinks and centers. */
body.sale .head { text-align: center; margin-bottom: 20px; }
body.sale #title { font-size: 15px; margin-bottom: 5px; }
body.sale #subtitle { font-size: 12.5px; color: rgba(255, 255, 255, 0.55); }

/* ---------- form ---------- */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.field label {
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}

.field input {
  height: 50px;
  width: 100%;
  padding: 0 15px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.field input::placeholder { color: rgba(255, 255, 255, 0.32); }
.field input:focus {
  border-color: #a99fc6;
  box-shadow: 0 0 0 3px rgba(132, 120, 168, 0.28);
}
.field.invalid input { border-color: rgba(231, 154, 154, 0.55); }

.banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 13px;
  border-radius: 11px;
  background: rgba(194, 94, 94, 0.14);
  border: 1px solid rgba(194, 94, 94, 0.34);
  color: #f0c8c8;
  font-size: 12.5px;
  line-height: 1.45;
}
.banner svg { flex-shrink: 0; }

.notice {
  margin: 0 0 14px;
  padding: 10px 13px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.82);
  font-size: 12.5px;
  line-height: 1.5;
}

.cta {
  width: 100%;
  height: 52px;
  margin-top: 6px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.06) 42%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, #a99fc6, #8478a8 55%, #756a94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -8px 14px rgba(103, 93, 133, 0.32),
    0 12px 30px rgba(132, 120, 168, 0.42);
  transition: background 0.18s ease, transform 0.12s ease, opacity 0.18s ease;
}
.cta:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.08) 42%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, #9c92b9, #756a94 55%, #675d85);
}
.cta:active { transform: translateY(1px); }
.cta:disabled { opacity: 0.6; cursor: default; }

.links {
  margin: 16px 0 0;
  display: flex;
  justify-content: center;
  gap: 14px;
}
.linkbtn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  padding: 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.linkbtn:hover { color: #ffffff; }

/* ---------- reveal on successful sign-in (before redirect) ---------- */
body.unlocked .stage { opacity: 0; }
body.unlocked .backdrop,
body.unlocked .scrim { opacity: 0; }

/* ---------- mobile ---------- */
@media (max-width: 480px) {
  .stage { padding: 28px 20px; align-items: flex-start; }
  .card { width: 100%; padding: 30px 26px 26px; border-radius: 18px; }
  .card::after { top: -100px; width: 260px; height: 200px; }
  .sale-headline { font-size: 26px; }
  .sale-sub { font-size: 13px; }
  .rule { margin: 22px 0 20px; }
  #title { font-size: 26px; }
  .field input { height: 48px; }
  .cta { height: 50px; font-size: 14.5px; }
}
