/* ============================================================
   Mind Core — Entry / Gateway page
   Split screen: cream auth (left) + premium media carousel (right)
   Shares the site palette: cream / beige / orange + Fraunces/Outfit
   ============================================================ */

:root {
  /* Surfaces */
  --bg:        #f6efe3;
  --bg-soft:   #f1e7d6;
  --paper:     #fffdf9;

  /* Deep warm — the showcase panel */
  --gate-dark:   #16110b;
  --gate-dark-2: #211a12;

  /* Ink (on cream) */
  --ink:       #221b12;
  --ink-soft:  #5c5043;
  --ink-faint: #9a8d7c;

  /* Ink (on dark) */
  --dk-ink:    #f7efe2;
  --dk-soft:   rgba(247, 239, 226, 0.74);
  --dk-faint:  rgba(247, 239, 226, 0.5);

  /* Accent */
  --accent:        #e4621a;
  --accent-bright: #f47c2e;
  --accent-deep:   #b9490a;
  --accent-soft:   rgba(228, 98, 26, 0.12);

  /* Lines */
  --hair:        rgba(40, 30, 18, 0.12);
  --hair-strong: rgba(40, 30, 18, 0.22);

  --r-card: 26px;
  --r-pill: 999px;

  --f-serif: "Fraunces", "Times New Roman", serif;
  --f-sans:  "Outfit", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
.hidden { display: none !important; }

body.gate-body {
  font-family: var(--f-sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 720px at 82% 4%, #ffe6cb 0%, transparent 58%),
    radial-gradient(900px 620px at -4% 96%, #efe2cd 0%, transparent 55%),
    var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Decorative grain + auras (fixed, no scroll cost) */
.grain {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.aura {
  position: fixed; border-radius: 50%; filter: blur(80px);
  pointer-events: none; z-index: 0;
}
.aura-1 {
  width: 560px; height: 560px; top: -180px; left: -140px;
  background: radial-gradient(circle, rgba(244, 124, 46, 0.26), transparent 65%);
  animation: drift 16s ease-in-out infinite;
}
.aura-2 {
  width: 460px; height: 460px; bottom: -160px; left: 24%;
  background: radial-gradient(circle, rgba(232, 188, 120, 0.30), transparent 65%);
  animation: drift 20s ease-in-out infinite reverse;
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(26px, -20px) scale(1.06); }
}

/* ============================================================
   GATE LAYOUT — asymmetric split
   ============================================================ */
.gate {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(420px, 0.92fr) 1.14fr;
  min-height: 100dvh;
}

/* ============================================================
   LEFT — AUTH
   ============================================================ */
.gate-auth {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 48px;
}
.auth-inner {
  width: 100%; max-width: 392px;
  display: flex; flex-direction: column;
}

/* brand row */
.auth-brand {
  display: inline-flex; align-items: center; gap: 11px;
  margin-bottom: auto;
  text-decoration: none; color: var(--ink);
}
.auth-brand img { width: 34px; height: 34px; border-radius: 9px; display: block; }
.auth-brand b {
  font-family: var(--f-serif); font-weight: 500; font-size: 19px;
  letter-spacing: -0.01em; font-variation-settings: "opsz" 60;
}
.auth-brand span {
  font-size: 11px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint);
  padding-left: 11px; margin-left: 3px; border-left: 1px solid var(--hair-strong);
}

/* head */
.auth-head { margin: 38px 0 26px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 12.5px; font-weight: 500;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border: 1px solid rgba(228, 98, 26, 0.22);
  padding: 6px 14px; border-radius: var(--r-pill);
  margin-bottom: 18px;
}
.eyebrow .spark { width: 13px; height: 13px; fill: var(--accent); }
.auth-title {
  font-family: var(--f-serif); font-weight: 400;
  font-size: clamp(30px, 3.2vw, 42px);
  line-height: 1.02; letter-spacing: -0.025em; color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 50;
}
.auth-title em {
  font-style: italic; font-weight: 500; color: var(--accent-deep);
}
.auth-sub {
  margin-top: 13px; font-size: 14.5px; line-height: 1.6;
  color: var(--ink-soft); max-width: 38ch;
}

/* ---------- segmented tabs ---------- */
.auth-tabs {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr;
  background: rgba(40, 30, 18, 0.05);
  border: 1px solid var(--hair);
  border-radius: var(--r-pill);
  padding: 5px; margin-bottom: 22px;
}
.tab-ind {
  position: absolute; z-index: 0;
  top: 5px; bottom: 5px; left: 5px;
  width: calc(50% - 5px);
  background: var(--paper);
  border-radius: var(--r-pill);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 4px 12px -4px rgba(40, 30, 18, 0.22),
    0 0 0 1px rgba(228, 98, 26, 0.10);
  transition: transform .42s cubic-bezier(.16, 1, .3, 1);
}
.auth-tabs[data-active="register"] .tab-ind { transform: translateX(100%); }
.auth-tab {
  position: relative; z-index: 1;
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--ink-soft); background: none; border: 0; cursor: pointer;
  padding: 10px 0; border-radius: var(--r-pill);
  transition: color .3s ease;
}
.auth-tab.is-active { color: var(--accent-deep); }

/* ---------- forms ---------- */
.auth-form { display: none; }
.auth-form.is-active { display: grid; gap: 15px; }
/* only animate on an actual tab switch (class added by JS), never on first page load */
.auth-form.is-active.tab-switch {
  animation: form-in .5s cubic-bezier(.16, 1, .3, 1);
}
@keyframes form-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-field { display: grid; gap: 7px; }
.auth-field .lbl-row {
  display: flex; align-items: baseline; justify-content: space-between;
}
.auth-field label {
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.auth-link {
  font-size: 12.5px; font-weight: 500; color: var(--accent-deep);
  text-decoration: none; transition: color .2s ease;
}
.auth-link:hover { color: var(--accent); text-decoration: underline; }

.auth-input { position: relative; display: flex; align-items: center; }
.auth-input > svg.ic {
  position: absolute; left: 14px; width: 17px; height: 17px;
  color: var(--ink-faint); pointer-events: none;
  transition: color .25s ease;
}
.auth-input input {
  font-family: var(--f-sans); font-size: 15px; color: var(--ink);
  width: 100%;
  background: rgba(255, 253, 249, 0.66);
  border: 1px solid rgba(40, 30, 18, 0.14);
  border-radius: 14px;
  padding: 13px 15px 13px 41px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.auth-input input::placeholder { color: var(--ink-faint); }
.auth-input input:focus {
  outline: none; background: #fffdf9;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), inset 0 1px 2px rgba(40, 30, 18, 0.04);
}
.auth-input:focus-within > svg.ic { color: var(--accent); }
.auth-input input.has-eye { padding-right: 44px; }
.pw-eye {
  position: absolute; right: 8px;
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: none; border: 0; cursor: pointer; color: var(--ink-faint);
  transition: color .2s ease, background .2s ease;
}
.pw-eye:hover { color: var(--ink); background: rgba(40, 30, 18, 0.05); }
.pw-eye svg { width: 18px; height: 18px; }

/* invalid state */
.auth-field.invalid .auth-input input {
  border-color: #c2410c;
  box-shadow: 0 0 0 4px rgba(194, 65, 12, 0.10);
}
.auth-field.invalid .auth-input > svg.ic { color: #c2410c; }
.auth-err {
  font-size: 12px; color: #c2410c; font-weight: 500;
  min-height: 0; max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height .25s ease, opacity .25s ease;
}
.auth-field.invalid .auth-err { max-height: 28px; opacity: 1; }

/* password strength meter */
.pw-meter { display: flex; gap: 5px; margin-top: 2px; }
.pw-meter span {
  height: 3px; flex: 1; border-radius: 3px;
  background: rgba(40, 30, 18, 0.12);
  transition: background .3s ease;
}
.pw-meter[data-score="1"] span:nth-child(1) { background: #c2410c; }
.pw-meter[data-score="2"] span:nth-child(-n+2) { background: var(--accent-bright); }
.pw-meter[data-score="3"] span { background: #2f8f5b; }
.pw-hint { font-size: 11.5px; color: var(--ink-faint); margin-top: 1px; }

/* remember row */
.auth-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: -2px 0 2px;
}
.auth-check {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--ink-soft); cursor: pointer; user-select: none;
}
.auth-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.auth-check .box {
  width: 18px; height: 18px; border-radius: 6px;
  border: 1px solid var(--hair-strong); background: rgba(255, 253, 249, 0.7);
  display: grid; place-items: center; transition: all .2s ease;
}
.auth-check .box svg { width: 12px; height: 12px; color: #fff; opacity: 0; transform: scale(.5); transition: all .2s ease; }
.auth-check input:checked + .box {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  border-color: transparent;
}
.auth-check input:checked + .box svg { opacity: 1; transform: scale(1); }
.auth-check input:focus-visible + .box { box-shadow: 0 0 0 4px var(--accent-soft); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: inherit; font-weight: 600; font-size: 15px;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  border-radius: var(--r-pill); padding: 14px 22px; white-space: nowrap;
  transition: transform .18s cubic-bezier(.16, 1, .3, 1),
    box-shadow .25s ease, background .2s ease, border-color .2s ease, opacity .2s ease;
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  color: #fff;
  box-shadow: 0 10px 26px -8px rgba(228, 98, 26, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -10px rgba(228, 98, 26, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}
.btn-primary[data-loading="true"] { pointer-events: none; opacity: 0.85; }
.btn .arrow { width: 17px; height: 17px; transition: transform .25s cubic-bezier(.16, 1, .3, 1); }
.btn-primary:hover .arrow { transform: translateX(3px); }
.btn-block { width: 100%; }

/* spinner inside button */
.btn .spin { display: none; width: 17px; height: 17px; animation: spin .7s linear infinite; }
.btn[data-loading="true"] .spin { display: block; }
.btn[data-loading="true"] .lbl,
.btn[data-loading="true"] .arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* divider */
.auth-or {
  display: flex; align-items: center; gap: 14px;
  margin: 22px 0 16px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.04em;
  color: var(--ink-faint); text-transform: uppercase;
}
.auth-or::before, .auth-or::after {
  content: ""; flex: 1; height: 1px; background: var(--hair);
}

/* social + guest */
.auth-social { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-soft {
  background: rgba(255, 253, 249, 0.6);
  color: var(--ink); border-color: var(--hair-strong);
  backdrop-filter: blur(6px); font-size: 14px; padding: 12px 16px;
}
.btn-soft:hover {
  transform: translateY(-2px); border-color: var(--ink);
  background: var(--paper); box-shadow: 0 12px 26px -14px rgba(40, 30, 18, 0.4);
}
.btn-soft svg { width: 18px; height: 18px; }

.btn-guest {
  margin-top: 10px; width: 100%;
  background: none; color: var(--ink-soft);
  border: 1px dashed var(--hair-strong); font-size: 14px;
}
.btn-guest:hover {
  color: var(--accent-deep); border-color: var(--accent);
  background: var(--accent-soft); border-style: solid;
}
.btn-guest .g-ic { width: 17px; height: 17px; }

.auth-legal {
  margin-top: 26px; font-size: 12px; line-height: 1.6;
  color: var(--ink-faint);
}
.auth-legal a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
.auth-legal a:hover { color: var(--accent-deep); }

/* auth column — shown immediately, no entrance animation (was causing a flash on load) */
.r-up { opacity: 1; transform: none; }

/* ============================================================
   RIGHT — SHOWCASE CAROUSEL
   ============================================================ */
.gate-show {
  position: relative;
  background:
    radial-gradient(700px 520px at 80% 8%, rgba(244, 124, 46, 0.16), transparent 60%),
    linear-gradient(160deg, var(--gate-dark-2), var(--gate-dark));
  padding: 18px;
}
.wc {
  position: relative; height: 100%; min-height: 540px;
  border-radius: 30px; overflow: hidden;
  background: #0e0a06;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 40px 100px -40px rgba(0, 0, 0, 0.7),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* slides stack */
.wc-stage { position: absolute; inset: 0; }
.wc-slide {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity .9s ease, visibility .9s;
}
.wc-slide.is-active { opacity: 1; visibility: visible; }
.wc-slide img,
.wc-slide video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  display: block; background: #0e0a06;
}
/* ken-burns on the active slide media */
.wc-slide.is-active img,
.wc-slide.is-active video {
  animation: kenburns 9s ease-out forwards;
}
@keyframes kenburns {
  from { transform: scale(1.02); }
  to   { transform: scale(1.11); }
}
/* readability scrim — bottom + corners */
.wc-scrim {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(to top, rgba(12, 8, 4, 0.86) 0%, rgba(12, 8, 4, 0.28) 34%, transparent 56%),
    linear-gradient(to bottom, rgba(12, 8, 4, 0.5) 0%, transparent 26%);
}

/* refraction frame + glow strip */
.wc-frame {
  position: absolute; inset: 0; z-index: 6; pointer-events: none;
  border-radius: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 -60px 80px -50px rgba(228, 98, 26, 0.18);
}
.wc-glow {
  position: absolute; top: 0; left: 12%; right: 12%; height: 1px; z-index: 7;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(244, 124, 46, 0.6) 50%, transparent);
  box-shadow: 0 0 14px 2px rgba(228, 98, 26, 0.18);
}
.wc-shimmer { position: absolute; inset: 0; z-index: 7; overflow: hidden; border-radius: inherit; pointer-events: none; }
.wc-shimmer::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.07) 48%, transparent 58%);
  transform: translateX(-120%);
  animation: shimmer 8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes shimmer { 0% { transform: translateX(-120%); } 32%, 100% { transform: translateX(120%); } }

/* top bar */
.wc-topbar {
  position: absolute; top: 22px; left: 24px; right: 24px; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
}
.wc-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500; color: rgba(255, 246, 235, 0.92);
  background: rgba(20, 16, 11, 0.42); border: 1px solid rgba(255, 246, 235, 0.16);
  backdrop-filter: blur(10px); padding: 7px 13px; border-radius: var(--r-pill);
}
.wc-chip .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent-bright);
  box-shadow: 0 0 0 0 rgba(244, 124, 46, 0.5); animation: live 2.4s ease-out infinite;
}
@keyframes live {
  0%   { box-shadow: 0 0 0 0 rgba(244, 124, 46, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(244, 124, 46, 0); }
  100% { box-shadow: 0 0 0 0 rgba(244, 124, 46, 0); }
}
.wc-count {
  font-size: 12px; color: var(--dk-soft); letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}
.wc-count b { color: var(--dk-ink); font-weight: 600; }

/* caption */
.wc-caption {
  position: absolute; left: 28px; right: 28px; bottom: 58px; z-index: 5;
  color: var(--dk-ink);
}
.wc-kicker {
  display: inline-block; font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-bright);
  margin-bottom: 8px;
}
.wc-title {
  font-family: var(--f-serif); font-weight: 400; font-style: italic;
  font-size: clamp(28px, 3vw, 40px); line-height: 1.04; letter-spacing: -0.02em;
  font-variation-settings: "opsz" 110;
}
.wc-anim { animation: cap-in .55s cubic-bezier(.16, 1, .3, 1); }
@keyframes cap-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* controls (arrows + mute) */
.wc-ctrls { position: absolute; right: 24px; bottom: 56px; z-index: 6; display: flex; gap: 9px; }
.wc-btn {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(20, 16, 11, 0.42); border: 1px solid rgba(255, 246, 235, 0.16);
  backdrop-filter: blur(10px); color: rgba(255, 246, 235, 0.92); cursor: pointer;
  transition: transform .2s cubic-bezier(.16, 1, .3, 1), background .2s ease, border-color .2s ease;
}
.wc-btn:hover { background: rgba(228, 98, 26, 0.5); border-color: rgba(255, 246, 235, 0.3); transform: translateY(-2px); }
.wc-btn:active { transform: scale(.92); }
.wc-btn svg { width: 18px; height: 18px; }
.wc-btn .ic-hide { display: none; }
.wc-btn.is-muted .ic-show { display: none; }
.wc-btn.is-muted .ic-hide { display: block; }

/* segmented progress rail */
.wc-rail {
  position: absolute; left: 28px; right: 28px; bottom: 26px; z-index: 5;
  display: flex; gap: 7px;
}
.wc-seg {
  flex: 1; height: 3px; border-radius: 3px;
  background: rgba(255, 246, 235, 0.22); overflow: hidden; cursor: pointer;
  position: relative; padding: 0; border: 0;
}
.wc-seg::after {
  content: ""; position: absolute; inset: 0; transform: scaleX(0); transform-origin: left;
  background: linear-gradient(90deg, var(--accent-bright), var(--accent));
}
.wc-seg.is-done::after { transform: scaleX(1); }
.wc-seg.is-active::after { animation: wc-fill var(--dur, 6000ms) linear forwards; }
.wc.is-paused .wc-seg.is-active::after { animation-play-state: paused; }
@keyframes wc-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .gate { grid-template-columns: 1fr; }
  .gate-show { order: -1; padding: 12px; min-height: 38vh; }
  .wc { min-height: 38vh; border-radius: 22px; }
  .wc-caption { bottom: 44px; }
  .wc-ctrls { bottom: 42px; }
  .gate-auth { padding: 36px 24px 48px; }
  .auth-inner { max-width: 440px; }
  .auth-brand { margin-bottom: 28px; }
}
@media (max-width: 420px) {
  .auth-social { grid-template-columns: 1fr; }
  .gate-auth { padding: 28px 18px 40px; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .aura, .wc-shimmer::after, .wc-chip .dot,
  .wc-slide.is-active img, .wc-slide.is-active video { animation: none !important; }
  .r-up { opacity: 1; transform: none; animation: none; }
  .wc-seg.is-active::after { animation: none !important; transform: scaleX(0.5); }
  .wc-slide { transition: opacity .2s ease; }
}
