/* ==========================================================================
   member.css — the member area: /login (sign-in) and /membership (join).
   Carries the Lounge's violet as the "behind the wall" accent, so the member
   zone reads as a different room from the sales pages. Depends on the tokens
   in styles.css; loaded only on those two pages.
   ========================================================================== */

:root {
  --violet:      #7B61FF;
  --violet-deep: #5B45D9;   /* readable on mist — matches .l4-section */
  --violet-mist: #EEEAFD;
}

/* --- Header: the member door --------------------------------------------- */
/* Ghost pill, one notch quieter than the mist CTA it sits beside. The ring
   glyph is the only place the mark repeats in the nav — it marks the door. */
.btn--member {
  background: #FFFFFF;
  color: var(--ink);
  border: 1px solid #E1E7E7;
  gap: .4375rem;
}
.btn--member:hover {
  background: var(--violet-mist);
  border-color: #DAD2FA;
  color: var(--violet-deep);
  box-shadow: 0 8px 20px rgba(123,97,255,.14);
}
.btn--member img { width: 15px; height: 15px; display: block; opacity: .75; }
.btn--member__short { display: none; }
.btn--member:hover img { opacity: 1; }
.btn--member[aria-current="page"] {
  background: var(--violet-mist);
  border-color: #DAD2FA;
  color: var(--violet-deep);
}

/* --- Construction mode: the door is visible but not yet open ------------- */
/* Grayed out while the member dashboard is being built. Deliberately still
   rendered — the pill announces the member area exists — but it navigates
   nowhere and drops the invitation colors. When the dashboard ships, restore
   the <a href="/login"> version of this control and delete this block. */
.btn--member--soon {
  position: relative;
  background: #F4F6F6;
  border-color: var(--hairline);
  color: var(--faint);
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn--member--soon img { opacity: .35; filter: grayscale(1); }
.btn--member--soon:hover {
  background: #F4F6F6;
  border-color: var(--hairline);
  color: var(--faint);
  transform: none;
  box-shadow: none;
}
.btn--member--soon:hover img { opacity: .35; }

/* Tooltip — same card language as the rest of the site. Shown on hover and
   keyboard focus; widgets.js adds .is-tipped on tap for touch screens. */
.member-tip {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 248px;
  background: #FFFFFF;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: var(--float-shadow);
  padding: .75rem .875rem;
  font-family: var(--sans);
  font-size: .8125rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--body);
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
  pointer-events: none;
  z-index: 120;
}
.member-tip::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 22px;
  width: 9px; height: 9px;
  background: #FFFFFF;
  border-left: 1px solid var(--hairline);
  border-top: 1px solid var(--hairline);
  transform: rotate(45deg);
}
.btn--member--soon:hover .member-tip,
.btn--member--soon:focus-visible .member-tip,
.btn--member--soon.is-tipped .member-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .member-tip { transition: none; }
}
/* On phones the bubble would overrun the left edge — pin it under the bar. */
@media (max-width: 560px) {
  .member-tip {
    position: fixed;
    top: 74px;
    left: var(--s3);
    right: var(--s3);
    width: auto;
  }
  .member-tip::before { display: none; }
}

/* The header now carries three things beside the lockup, so it steps down in
   two tiers. The lockup scales by breakpoint rather than being flex-shrunk —
   max-width on the <img> would narrow the box while the height stays fixed,
   which squashes the mark out of proportion. */
.site-header .wordmark { flex: 0 0 auto; }

/* Tier B (<=760) — the header wraps to two rows, so every control keeps a
   seat; things just tighten. */
@media (max-width: 760px) {
  .site-header .wordmark img { height: 23px; }
  .site-header__nav { gap: .75rem !important; }
}

/* Tier A (<=560) — the member door drops to the ring glyph alone: two worded
   pills plus the lockup do not fit, and the ring is the mark for exactly this.
   The label stays in the accessibility tree. */
@media (max-width: 560px) {
  .site-header__nav .btn--member { padding: .4375rem .8125rem; font-size: .8125rem; }
  .site-header__nav .btn--member img { display: none; }
  .btn--member__short { display: inline; }
  /* The full label leaves the page but stays the accessible name. */
  .btn--member__label {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Smallest phones still in the wild (SE 1st gen, fold covers) — everything
   steps down one more notch so nothing runs past the gutter. */
@media (max-width: 400px) {
  .site-header .wordmark img { height: 18px; }
  .site-header__inner { gap: .375rem; }
  .site-header__nav { gap: .5rem !important; }
  .site-header__nav .btn--sm { font-size: .6875rem; padding: .4375rem .625rem; }
  .site-header__nav .btn--member { font-size: .6875rem; padding: .4375rem .5625rem; }
}

/* --- /login --------------------------------------------------------------- */
.auth {
  min-height: calc(100vh - 68px - 84px);   /* header + footer */
  display: flex;
  align-items: center;
  padding-block: clamp(var(--s5), 7vw, var(--s8));
}
.auth__wrap { width: 100%; }

.auth__panel {
  max-width: 460px;
  margin-inline: auto;
  background: #FFFFFF;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  box-shadow: var(--float-shadow);
  padding: clamp(var(--s5), 5vw, var(--s6));
}

.auth__ring {
  width: 42px; height: 42px;
  margin-inline: auto;
  display: block;
}
.auth__title {
  font-size: 1.625rem;
  font-weight: 600;
  text-align: center;
  margin-top: var(--s3);
}
.auth__sub {
  text-align: center;
  color: var(--muted);
  font-size: .9375rem;
  line-height: 1.5;
  margin-top: .625rem;
}

.auth form { margin-top: var(--s4); }
.auth .pios-submit {
  background: var(--violet-mist);
  border-color: var(--violet-mist);
  color: var(--violet-deep);
}
.auth .pios-submit:hover { background: #E4DEFB; border-color: #E4DEFB; }
.auth .pios-input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(123,97,255,.15); }

.auth__fineprint {
  margin-top: var(--s3);
  text-align: center;
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--muted);   /* not --faint: that tone is decorative-only */
}

/* Sent state — replaces the form in place */
.auth__sent { text-align: center; margin-top: var(--s4); }
.auth__sent-mark {
  width: 46px; height: 46px;
  margin-inline: auto;
  border-radius: 50%;
  background: var(--violet-mist);
  color: var(--violet-deep);
  display: grid;
  place-items: center;
}
.auth__sent-mark svg { width: 22px; height: 22px; }
.auth__sent-title {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-top: var(--s3);
}
.auth__sent-text {
  margin-top: .625rem;
  font-size: .9375rem;
  line-height: 1.6;
  color: var(--body);
}
.auth__sent-text strong { color: var(--ink); font-weight: 600; }
.auth__resend {
  margin-top: var(--s4);
  font-size: .8125rem;
  color: var(--muted);
}
.auth__resend button {
  font: inherit;
  color: var(--violet-deep);
  font-weight: 600;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* The join-instead rail, hung under the card */
.auth__alt {
  max-width: 460px;
  margin: var(--s4) auto 0;
  background: var(--canvas-alt);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: var(--s4);
  text-align: center;
}
.auth__alt-title {
  font-family: var(--display);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.auth__alt-text {
  margin-top: .5rem;
  font-size: .9375rem;
  line-height: 1.55;
  color: var(--muted);
}
.auth__alt .btn { margin-top: var(--s3); }

/* --- /membership ---------------------------------------------------------- */
.mem-hero { padding-top: clamp(var(--s4), 3.5vw, var(--s6)); padding-bottom: var(--s6); }
.mem-hero__panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, #E4DDF7, #DDE1F2 54%, #CDE5EE);
  border-radius: 28px;
  padding: clamp(var(--s6), 6vw, var(--s8)) clamp(var(--s4), 4vw, var(--s6));
  text-align: center;
}
.mem-hero__chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--violet-deep);
  background: rgba(255,255,255,.78);
  border-radius: 999px;
  padding: .375rem .875rem;
}
.mem-hero__chip svg { width: 13px; height: 13px; }
.mem-hero__title {
  font-size: clamp(2.125rem, 5vw, 3.5rem);
  font-weight: 600;
  margin-top: var(--s4);
}
.mem-hero__lede {
  max-width: 34rem;
  margin: var(--s4) auto 0;
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  line-height: 1.55;
  color: #3F4547;
}
.mem-hero__actions {
  margin-top: var(--s5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  justify-content: center;
  align-items: center;
}
.mem-hero__signin {
  font-size: .9375rem;
  color: #4B5254;
}
.mem-hero__signin a {
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(23,24,26,.3);
}
.mem-hero__signin a:hover { text-decoration-color: var(--ink); }

/* --- The paywall preview: what the login opens onto ----------------------- */
.locked {
  position: relative;
  max-width: 900px;
  margin: calc(var(--s6) * -1 - var(--s2)) auto 0;
  background: #FFFFFF;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  box-shadow: var(--float-shadow);
  overflow: hidden;
  z-index: 2;
}
.locked__bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem var(--s4);
  border-bottom: 1px solid var(--hairline);
  background: #FBFCFC;
}
.locked__dot { width: 9px; height: 9px; border-radius: 50%; background: #E1E7E7; }
.locked__path {
  margin-left: .625rem;
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--faint);
}
.locked__body { position: relative; padding: var(--s5) var(--s4) var(--s6); }

/* The blurred stand-in rows — deliberately abstract shapes, not fake data */
.locked__rows { display: grid; gap: var(--s3); filter: blur(5px); opacity: .55; user-select: none; }
.locked__row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: var(--s3);
  align-items: center;
  padding: var(--s3);
  border: 1px solid var(--hairline);
  border-radius: 14px;
}
.locked__sq { height: 38px; border-radius: 10px; background: var(--violet-mist); }
.locked__lines { display: grid; gap: .5rem; }
.locked__line { height: 9px; border-radius: 999px; background: #E8ECEC; }
.locked__line--short { width: 42%; }
.locked__line--mid   { width: 68%; }
.locked__num { width: 62px; height: 22px; border-radius: 8px; background: #E3F4F2; }

.locked__veil {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--s4);
  text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.94) 62%);
}
.locked__lock {
  width: 44px; height: 44px;
  margin-inline: auto;
  border-radius: 50%;
  background: var(--violet-mist);
  color: var(--violet-deep);
  display: grid;
  place-items: center;
}
.locked__lock svg { width: 20px; height: 20px; }
.locked__title {
  font-family: var(--display);
  font-size: 1.1875rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
  margin-top: var(--s3);
}
.locked__text {
  margin-top: .5rem;
  font-size: .9375rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 30rem;
}

@media (max-width: 640px) {
  .mem-hero { padding-bottom: var(--s5); }
  .locked { margin-top: calc(var(--s4) * -1); }
  .locked__row { grid-template-columns: 30px 1fr; }
  .locked__num { display: none; }
}

/* --- Shared member-area section rhythm ------------------------------------ */
.mem-section { padding-block: var(--s7); }
.mem-section--alt { background: #FBFCFC; border-top: 1px solid var(--hairline); }
.mem-head { max-width: var(--measure); margin-inline: auto; text-align: center; }
.mem-head__title { font-weight: 600; }
.mem-head__lede { margin-top: var(--s3); }

.mem-cta { text-align: center; margin-top: var(--s6); }
.mem-cta__note { margin-top: var(--s3); font-size: .875rem; color: var(--muted); }

/* Reduced motion / no-JS: nothing here animates on its own, but the shared
   .reveal class is used in the markup — keep it inert if widgets never run. */
@media (prefers-reduced-motion: reduce) {
  .btn--member { transition: none; }
}

/* Phones: the header becomes a tidy two-row grid —
   PIOS mark | Become a Member
   link pills | Log in
   Nothing touches the header's top or bottom edge. */
.wordmark__short { display: none; }
.nav-links { display: contents; }
@media (max-width: 700px) {
  .site-header__inner {
    display: grid !important;
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand login" "links join";
    align-items: center;
    row-gap: .625rem;
    padding-block: .875rem;
  }
  .site-header__nav { display: contents !important; } /* beats the inline flex style */
  .wordmark { grid-area: brand; white-space: nowrap; }
  .wordmark .wordmark__full { display: none; }
  .wordmark__short {
    display: inline-flex; align-items: center; gap: .45rem;
    font-family: "Schibsted Grotesk", system-ui, sans-serif;
    font-weight: 800; font-size: 1.0625rem; letter-spacing: .01em;
    color: #17181A;
  }
  .nav-links { display: flex; grid-area: links; gap: .5rem; flex-wrap: wrap; row-gap: .375rem; min-width: 0; }
  .nav-links .nav-link {
    border: 1px solid var(--hairline, #E3E8E8);
    border-radius: 999px;
    padding: .375rem .6875rem;
    font-size: .78125rem; font-weight: 600;
    background: #fff;
    white-space: nowrap;
  }
  .nav-links .nav-link[aria-current="page"] {
    border-color: rgba(43, 179, 163, .65);
    color: var(--teal-deep, #16655C);
  }
  .site-header__nav > .btn:not(.btn--member) { grid-area: join; justify-self: end; }
  .site-header__nav .btn--member {
    grid-area: login;
    justify-self: end;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    font-size: .875rem;
    font-weight: 600;
    color: var(--muted, #5A6463);
    transition: color .2s ease;
  }
  .site-header__nav .btn--member:hover,
  .site-header__nav .btn--member:active { color: var(--teal-deep, #16655C); }
  .site-header__nav .btn--member img { display: none; }
  .btn--member__short { display: inline; }
  .btn--member__label {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
}

/* The narrowest phones: buttons tighten so nothing leaves the frame. */
@media (max-width: 374px) {
  .nav-links { flex-wrap: wrap; row-gap: .375rem; min-width: 0; }
  .site-header__nav > .btn:not(.btn--member) { font-size: .71875rem !important; padding: .375rem .625rem !important; }
  .site-header__nav .btn--member { font-size: .75rem !important; }
  .nav-links .nav-link { font-size: .71875rem; padding: .3125rem .5625rem; }
  .wordmark__short { font-size: 1rem; }
}


/* The membership CTA carries a slow, subtle sheen — same color, more pull. */
.site-header__nav > .btn:not(.btn--member) {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.site-header__nav > .btn:not(.btn--member)::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(115deg,
    transparent 30%, rgba(255, 255, 255, .85) 46%,
    rgba(43, 179, 163, .18) 54%, transparent 70%);
  transform: translateX(-120%);
  animation: cta-sheen 4.5s ease-in-out infinite;
}
@keyframes cta-sheen {
  0%, 55% { transform: translateX(-120%); }
  85%, 100% { transform: translateX(120%); }
}
@media (prefers-reduced-motion: reduce) {
  .site-header__nav > .btn:not(.btn--member)::after { animation: none; }
}
