/* ==========================================================================
   UNDETECTABLE UGC — MEMBER AREA
   Styles for access.html: the email gate and the unlocked content.
   Requires base.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   STATE SWITCH — one page, two faces
   -------------------------------------------------------------------------- */

body:not(.is-unlocked) [data-view="unlocked"] { display: none; }
body.is-unlocked       [data-view="locked"]   { display: none; }

/* Hide both until access.js has decided which one to show, so a returning
   member never sees the gate flash before the content appears. */
body:not(.is-ready) [data-view] { visibility: hidden; }

/* ==========================================================================
   1. THE GATE
   ========================================================================== */

.gate {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 6vw, 3rem) var(--gut);
  position: relative;
  background:
    radial-gradient(ellipse 60% 50% at 50% 30%, rgba(212, 255, 63, 0.09), transparent 65%),
    var(--ink);
}

/* Measurement grid, same language as the sales hero */
.gate::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.026) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.026) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(ellipse 60% 55% at 50% 40%, #000 25%, transparent 76%);
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 40%, #000 25%, transparent 76%);
}

.gate__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: clamp(2rem, 6vw, 3rem) clamp(1.5rem, 5vw, 2.5rem);
  background: var(--ink-card);
  border: 1px solid var(--ink-line);
  border-radius: 6px;
  box-shadow: 0 40px 100px -45px rgba(0, 0, 0, 0.95);
  text-align: center;
  animation: gate-in 0.7s var(--ease) both;
}

@keyframes gate-in {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

/* Corner brackets on the card itself */
.gate__card::before,
.gate__card::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid var(--lime);
  pointer-events: none;
}

.gate__card::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.gate__card::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.gate__mark {
  font-family: var(--display);
  font-size: 1.25rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.gate__mark span { color: var(--lime); }

.gate__mark i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 12px var(--lime);
}

.gate h1 {
  font-family: var(--display);
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  text-transform: uppercase;
  line-height: 0.95;
  margin-bottom: 0.85rem;
}

.gate__sub {
  color: var(--paper-dim);
  font-size: 0.9375rem;
  font-weight: 300;
  margin-bottom: 2rem;
  text-wrap: balance;
}

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

.gate__form { display: grid; gap: 0.85rem; text-align: left; }

.field label {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-mute);
  display: block;
  margin-bottom: 0.6rem;
}

.field input {
  width: 100%;
  padding: 1rem 1.1rem;
  background: var(--ink);
  border: 1px solid var(--ink-line-2);
  border-radius: 3px;
  color: var(--paper);
  font-size: 1rem;
  font-weight: 300;
  transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.field input::placeholder { color: #4A4A56; }

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

body.has-error .field input {
  border-color: var(--alert);
  box-shadow: 0 0 0 3px var(--alert-glow);
}

/* ---- Error message ------------------------------------------------------- */

.gate__error {
  display: none;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.8125rem;
  font-weight: 300;
  color: var(--alert);
  line-height: 1.5;
  animation: shake 0.36s var(--ease);
}

body.has-error .gate__error { display: flex; }

.gate__error::before {
  content: "×";
  font-family: var(--mono);
  font-size: 0.9375rem;
  line-height: 1.35;
  flex: none;
}

.gate__error a { color: var(--lime); }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  22%      { transform: translateX(-5px); }
  55%      { transform: translateX(4px); }
  80%      { transform: translateX(-2px); }
}

/* ---- Loading state ------------------------------------------------------- */

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(8, 8, 10, 0.28);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: none;
}

body.is-checking .spinner { display: block; }
body.is-checking .btn__label { opacity: 0.55; }

@keyframes spin { to { transform: rotate(360deg); } }

.gate__help {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ink-line);
  font-size: 0.8125rem;
  font-weight: 300;
  color: var(--paper-mute);
  line-height: 1.6;
}

.gate__help a { color: var(--lime); }

/* ==========================================================================
   2. THE MEMBER AREA
   ========================================================================== */

.bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 8, 10, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--ink-line);
}

.bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
}

.bar__who {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar__who b {
  color: var(--paper);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.03em;
}

.bar__out {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper-mute);
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--ink-line);
  border-radius: 3px;
  flex: none;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.bar__out:hover { color: var(--alert); border-color: var(--alert); }

/* ---- Welcome + progress -------------------------------------------------- */

.hall { padding-block: clamp(2.5rem, 6vw, 4rem) clamp(4rem, 9vw, 6rem); }

.hall__head { margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }

.hall__head h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 6.5vw, 3.25rem);
  text-transform: uppercase;
  line-height: 0.94;
  margin-block: 1.25rem 1rem;
}

.progress {
  margin-top: 2rem;
  max-width: 520px;
}

.progress__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-mute);
  margin-bottom: 0.75rem;
}

.progress__meta b { color: var(--lime); font-weight: 500; }

.progress__track {
  height: 4px;
  border-radius: 100px;
  background: var(--ink-line);
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  width: 0%;
  border-radius: 100px;
  background: var(--lime);
  box-shadow: 0 0 14px var(--lime-glow);
  transition: width 0.6s var(--ease);
}

/* ---- Module list --------------------------------------------------------- */

.modules { display: grid; gap: 1.25rem; }

.module {
  background: var(--ink-card);
  border: 1px solid var(--ink-line);
  border-radius: 5px;
  overflow: hidden;
  transition: border-color 0.3s var(--ease);
}

.module:hover { border-color: var(--ink-line-2); }
.module.is-done { border-color: rgba(212, 255, 63, 0.32); }

.module__head {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  padding: clamp(1.15rem, 3vw, 1.5rem);
  cursor: pointer;
  list-style: none;
}

.module__head::-webkit-details-marker { display: none; }

.module__no {
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--paper-mute);
  width: 2.25rem;
  flex: none;
  transition: color 0.3s var(--ease);
}

.module.is-done .module__no { color: var(--lime); }

.module__title { flex: 1; min-width: 0; }

.module__title h2 {
  font-family: var(--display);
  font-size: clamp(1.125rem, 2.6vw, 1.375rem);
  text-transform: uppercase;
  line-height: 1.05;
  margin-bottom: 0.25rem;
}

.module__title p {
  font-size: 0.8125rem;
  font-weight: 300;
  color: var(--paper-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module__chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--paper-mute);
  border-bottom: 2px solid var(--paper-mute);
  transform: rotate(45deg);
  flex: none;
  transition: transform 0.3s var(--ease), border-color 0.25s var(--ease);
}

.module[open] .module__chevron {
  transform: rotate(-135deg);
  border-color: var(--lime);
}

.module__body {
  padding: 0 clamp(1.15rem, 3vw, 1.5rem) clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid var(--ink-line);
  padding-top: clamp(1.5rem, 3vw, 2rem);
}

/* Video slot — 9:16 on phones, 16:9 from tablet up */
.player {
  aspect-ratio: 16 / 9;
  background: var(--ink);
  border: 1px solid var(--ink-line);
  border-radius: 4px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.player iframe, .player video { width: 100%; height: 100%; border: 0; }

.player__empty {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-mute);
  line-height: 1.8;
}

.module__body > p {
  color: var(--paper-dim);
  font-size: 0.9375rem;
  font-weight: 300;
  max-width: var(--max-text);
}

.module__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.25rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--ink-line);
}

.dl {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper);
  text-decoration: none;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--ink-line-2);
  border-radius: 3px;
  transition: border-color 0.22s var(--ease), color 0.22s var(--ease);
}

.dl:hover { border-color: var(--lime); color: var(--lime); }

/* Placeholder state, until the real file is attached. Shipping an <a href="#">
   that looks clickable and does nothing is worse than saying so — swap the
   href for the real file and drop this class to activate the button. */
.dl--soon {
  color: var(--paper-mute);
  border-style: dashed;
  cursor: default;
  pointer-events: none;
}

/* Mark-as-complete toggle */
.done {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper-mute);
  margin-left: auto;
  user-select: none;
  transition: color 0.22s var(--ease);
}

.done:hover { color: var(--paper); }

.done input { position: absolute; opacity: 0; width: 0; height: 0; }

.done__box {
  width: 19px;
  height: 19px;
  border: 1px solid var(--ink-line-2);
  border-radius: 3px;
  display: grid;
  place-items: center;
  flex: none;
  transition: background 0.22s var(--ease), border-color 0.22s var(--ease);
}

.done__box::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(-45deg) scale(0);
  transition: transform 0.22s var(--ease);
}

.done input:checked + .done__box {
  background: var(--lime);
  border-color: var(--lime);
}

.done input:checked + .done__box::after { transform: rotate(-45deg) scale(1); }
.done input:focus-visible + .done__box { outline: 2px solid var(--lime); outline-offset: 2px; }
.done:has(input:checked) { color: var(--lime); }

/* ---- Bonus shelf --------------------------------------------------------- */

.shelf {
  margin-top: clamp(3rem, 7vw, 4.5rem);
  padding-top: clamp(2.5rem, 5vw, 3.5rem);
  border-top: 1px solid var(--ink-line);
}

.shelf__grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 2rem;
}

@media (min-width: 760px) {
  .shelf__grid { grid-template-columns: repeat(3, 1fr); }
}

.shelf__item {
  background: var(--ink-card);
  border: 1px solid var(--ink-line);
  border-radius: 5px;
  padding: clamp(1.4rem, 3vw, 1.85rem);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.shelf__item h3 {
  font-family: var(--display);
  font-size: 1.25rem;
  text-transform: uppercase;
  line-height: 1.05;
}

.shelf__item p {
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--paper-dim);
  flex: 1;
}

.shelf__item .dl { align-self: flex-start; margin-top: 0.5rem; }

/* ---- Help block ---------------------------------------------------------- */

.help {
  margin-top: clamp(3rem, 7vw, 4.5rem);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border: 1px solid var(--ink-line);
  border-radius: 5px;
  background: var(--ink-raised);
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  align-items: center;
  justify-content: space-between;
}

.help h3 {
  font-family: var(--display);
  font-size: 1.25rem;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.help p { font-size: 0.875rem; font-weight: 300; color: var(--paper-dim); }
