/* ═══════════════════════════════════════════════════════════════
   COMMUNE — Auth Pages  ·  Login / Register
   Split-screen on desktop, full-screen card on mobile
   ═══════════════════════════════════════════════════════════════ */
html, body { height: auto; overflow: auto; }

/* Body bg fill — no brown bleed-through on mobile */
body {
  background: var(--night-0);
  min-height: 100vh;
}

/* ── Shell layout ─────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  /* z-index removed — was breaking backdrop-filter on glass panels */
}

/* ── Left panel (desktop only) ────────────────────────────── */
.auth-left {
  display: flex;
  flex-direction: column;
  padding: 40px 52px;
  border-right: 1px solid var(--gl-bd-0);
  background: linear-gradient(160deg, rgba(124,111,255,.06) 0%, transparent 55%);
}
.auth-left-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 0 40px;
}
.auth-h {
  font-family: var(--ff-display);
  font-size: clamp(3rem, 5vw, 5rem);
  font-weight: 200;
  line-height: 1.04;
  letter-spacing: -.04em;
  color: var(--tx-0);
  margin-bottom: 18px;
}
.auth-h em { font-style: italic; color: var(--tx-1); }
.auth-p {
  font-size: 1.0625rem;
  color: var(--tx-1);
  line-height: 1.72;
  max-width: 380px;
  margin-bottom: 40px;
}
.perk-list  { display: flex; flex-direction: column; gap: 16px; max-width: 380px; }
.perk       { display: flex; align-items: center; gap: 14px; }
.perk-ic {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 10px;
  background: color-mix(in srgb, var(--c, var(--iris)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, var(--iris)) 24%, transparent);
  display: flex; align-items: center; justify-content: center;
  color: var(--c, var(--iris));
}
.perk span { font-size: .9rem; color: var(--tx-1); }

/* Testimonial quote */
.auth-quote {
  border-radius: var(--r-xl);
  padding: 26px;
  max-width: 400px;
  position: relative;
}
.aq-mark {
  font-family: var(--ff-display);
  font-size: 3.5rem;
  color: var(--iris);
  line-height: 1;
  margin-bottom: 6px;
  opacity: .6;
}
.aq-text {
  font-size: .9375rem;
  color: var(--tx-1);
  line-height: 1.65;
  font-style: italic;
  margin-bottom: 14px;
}
.aq-who { display: flex; align-items: center; gap: 10px; }
.aq-who strong { display: block; font-size: .86rem; color: var(--tx-0); }
.aq-who span   { font-size: .73rem; color: var(--tx-2); }

/* ── Right panel ──────────────────────────────────────────── */
.auth-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}

/* ── Card ─────────────────────────────────────────────────── */
.auth-card {
  width: 100%;
  max-width: 440px;
  border-radius: var(--r-xl);
  padding: 40px;
}
.auth-title {
  font-family: var(--ff-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--tx-0);
  letter-spacing: -.03em;
  margin-bottom: 5px;
}
.auth-sub    { font-size: .875rem; color: var(--tx-1); margin-bottom: 26px; }
.auth-link   { color: var(--iris); font-weight: 500; }
.auth-link:hover { color: #9B6DFF; }

/* Error banner */
.auth-err {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(251,113,133,.1);
  border: 1px solid rgba(251,113,133,.25);
  color: var(--coral);
  padding: 11px 14px;
  border-radius: var(--r-sm);
  font-size: .875rem;
  margin-bottom: 18px;
}

/* ── Form elements ────────────────────────────────────────── */
.pw-wrap { position: relative; }
.pw-wrap .fc { padding-right: 44px; }
.pw-eye {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--tx-2);
  display: flex; padding: 4px;
  transition: color var(--t-xs);
}
.pw-eye:hover { color: var(--tx-0); }

/* Column grid for name + username */
.col-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Agree checkbox row */
.agree-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 22px;
}
.agree-row input { margin-top: 3px; accent-color: var(--iris); flex-shrink: 0; }
.agree-row label { font-size: .82rem; color: var(--tx-1); cursor: pointer; line-height: 1.5; }

/* Or divider */
.or-div {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  font-size: .73rem;
  color: var(--tx-2);
}
.or-div::before, .or-div::after {
  content: ''; flex: 1; height: 1px; background: var(--gl-bd-0);
}

/* Social buttons */
.soc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.soc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--tx-1);
  background: var(--gl-0);
  border: 1px solid var(--gl-bd-0);
  cursor: pointer;
  transition: all var(--t-xs);
}
.soc-btn:hover {
  color: var(--tx-0);
  background: var(--gl-1);
  border-color: var(--gl-bd-1);
}

/* Footer note */
.auth-foot {
  margin-top: 18px;
  font-size: .73rem;
  color: var(--tx-2);
  text-align: center;
  max-width: 320px;
}
.auth-foot a { color: var(--iris); }

/* ── LIGHT MODE ───────────────────────────────────────────── */
[data-theme="light"] .auth-left {
  background: linear-gradient(160deg, rgba(91,79,232,.05) 0%, transparent 55%);
  border-right-color: rgba(0,0,0,.08);
}
[data-theme="light"] .auth-card {
  background: rgba(255,255,255,.85);
}

/* ══════════════════════════════════════════════════════════
   TABLET  (≤ 768px) — hide left panel, full-width right
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .auth-left { display: none; }
  .auth-right {
    min-height: 100vh;
    padding: 32px 24px 48px;
    justify-content: flex-start;
    align-items: stretch;
  }
  .auth-card {
    max-width: 100%;
    padding: 32px 28px;
    border-radius: var(--r-xl);
  }
}

/* ══════════════════════════════════════════════════════════
   MOBILE  (≤ 480px) — Galaxy S8 / iPhone SE sized screens
   ══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .auth-right {
    padding: 20px 16px 40px;
  }
  .auth-card {
    padding: 26px 20px;
    border-radius: var(--r-lg);
  }
  .auth-title { font-size: 1.75rem; }
  .auth-sub   { font-size: .82rem; margin-bottom: 20px; }

  /* Stack name + username vertically */
  .col-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* Tighter form controls */
  .fc     { padding: 11px 14px; font-size: .9rem; }
  .fl     { font-size: .72rem; }
  .fhint  { font-size: .72rem; }

  /* Agree checkbox */
  .agree-row        { margin-bottom: 18px; gap: 8px; }
  .agree-row label  { font-size: .78rem; }

  /* Submit button */
  .btn { font-size: .88rem; }

  /* Social */
  .soc-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .soc-btn { padding: 10px 8px; font-size: .78rem; gap: 6px; }

  /* Or divider */
  .or-div { margin: 14px 0; font-size: .7rem; }

  /* Footer */
  .auth-foot { font-size: .7rem; }
}

/* ══════════════════════════════════════════════════════════
   VERY SMALL  (≤ 360px) — Galaxy S8 exact width
   ══════════════════════════════════════════════════════════ */
@media (max-width: 360px) {
  .auth-right { padding: 16px 12px 32px; }
  .auth-card  { padding: 22px 16px; }
  .auth-title { font-size: 1.55rem; }
  .soc-row    { grid-template-columns: 1fr; }
  .soc-btn    { justify-content: center; }
}

/* ══════════════════════════════════════════════════════════
   MOBILE AUTH — Body and shell fill full screen
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Make the whole page fill the viewport with our background */
  html, body {
    height: 100%;
    min-height: 100%;
  }
  body {
    background: var(--night-0);
  }
  .auth-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--night-0);
  }
  .auth-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 40px;
    min-height: 100vh;
    background: var(--night-0);
  }
  /* Card fills width with breathing room */
  .auth-card {
    width: 100%;
    max-width: 420px;
    padding: 28px 24px;
    margin: 0 auto;
  }
}

/* ══════════════════════════════════════════════════════════
   AUTH TOPBAR — Home + Theme toggle row
   ══════════════════════════════════════════════════════════ */
.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 24px;
  flex-shrink: 0;
}
/* Brand inside auth-left proper position */
.auth-left > .brand {
  margin-bottom: 0;
}
.auth-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--tx-1);
  background: var(--gl-0);
  border: 1px solid var(--gl-bd-0);
  border-radius: var(--r-oo);
  text-decoration: none;
  transition: all var(--t-xs);
}
.auth-home-btn:hover {
  color: var(--tx-0);
  background: var(--gl-1);
  border-color: var(--gl-bd-1);
}
[data-theme="light"] .auth-home-btn {
  background: rgba(255,255,255,.55);
  border-color: rgba(0,0,0,.09);
}
[data-theme="light"] .auth-home-btn:hover {
  background: rgba(255,255,255,.85);
}

/* ── Remember Me ─────────────────────────────────────────── */
.remember-row {
  margin-bottom: 18px;
}
.remember-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: .86rem;
  color: var(--tx-1);
  user-select: none;
}
.remember-check { display: none; }
.remember-custom {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--gl-bd-1);
  background: var(--gl-0);
  flex-shrink: 0;
  transition: all var(--t-xs);
  position: relative;
}
.remember-check:checked + .remember-custom {
  background: var(--iris);
  border-color: var(--iris);
  box-shadow: 0 0 0 3px var(--iris-d);
}
.remember-check:checked + .remember-custom::after {
  content: '';
  position: absolute;
  top: 2px; left: 5px;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}
[data-theme="light"] .remember-custom {
  background: rgba(255,255,255,.7);
  border-color: rgba(0,0,0,.15);
}

/* ── Ensure no theme toggle overflows auth left panel ────── */
.auth-left .theme-toggle {
  flex-shrink: 0;
}

/* Mobile auth: hide left panel topbar, show inline toggle */
@media (max-width: 768px) {
  .auth-left { display: none; }
  .auth-right {
    position: relative;
  }
  /* Add a topbar inside auth-right on mobile */
  .auth-right::before {
    content: '';
    display: block;
    height: 16px;
  }
}

/* ── Mobile auth topbar (shown when auth-left hidden) ──────── */
.auth-mob-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 20px;
  width: 100%;
  max-width: 420px;
}
@media (max-width: 768px) {
  .auth-mob-bar { display: flex; }
}
