/* ══════════════════════════════════════════
   BENCH BIO — AUTH STYLES
   Matches index-styles.css design tokens
   Font: DM Sans | Scale: 8px base grid
══════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  --navy:        #371e1d;
  --navy-mid:    #2e1918;
  --navy-light:  #4a2a28;

  --bg-page:     #f5f3f0;
  --bg-surface:  #ffffff;
  --bg-card:     #ffffff;
  --bg-input:    #f9f8f6;

  --ink:         #1a1210;
  --ink-soft:    #6b5c57;
  --ink-muted:   #a8978f;

  --border:        rgba(55,30,29,0.10);
  --border-hover:  rgba(55,30,29,0.18);
  --border-focus:  rgba(13,167,154,0.45);

  --teal:        #0da79a;
  --teal-dim:    #0b8f84;
  --teal-soft:   rgba(13,167,154,0.10);
  --teal-glow:   rgba(13,167,154,0.22);

  --red:         #dc2626;
  --green:       #059669;

  --r-pill:  8px;
  --r-card:  8px;
  --r-input: 8px;
  --r-sm:    8px;

  --shadow-card: 0 2px 8px rgba(55,30,29,0.06), 0 16px 48px rgba(55,30,29,0.12);
  --shadow-sm:   0 1px 3px rgba(55,30,29,0.08), 0 4px 12px rgba(55,30,29,0.06);
  --glow-teal:   0 0 24px rgba(13,167,154,0.18);
}

/* ── Reset & Base ── */
*, *::before, *::after { padding: 0; margin: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ══════════════════════════════════════════
   GRADIENT BACKGROUND — mirrors index hero
   Olive / amber / rust mesh
══════════════════════════════════════════ */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 60% at 30% 40%, #c4720a 0%, transparent 55%),
    radial-gradient(ellipse 50% 55% at 75% 65%, #3a5c2a 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 60% 15%, #8a6a22 0%, transparent 50%),
    #3d3418;
  filter: saturate(0.9) brightness(0.88);
}

/* Noise texture overlay for depth */
.bg-gradient::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.35;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* Soft vignette — recedes the mesh at the edges so the card reads as
   the clear focal point instead of competing with bright corners */
.bg-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 75% at 50% 50%, transparent 40%, rgba(26,18,16,0.35) 100%);
  pointer-events: none;
}

/* ══════════════════════════════════════════
   AUTH CARD
══════════════════════════════════════════ */
.auth-wrap {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  padding: 16px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 40px 40px 36px;
  position: relative;
  animation: cardReveal 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* Teal accent line at top of card */
.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 40px; right: 40px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--teal-glow), transparent);
  border-radius: 0 0 2px 2px;
}

/* ── Logo ── */
.auth-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  margin-bottom: 28px;
  justify-content: center;
}

.auth-logo-mark {
  width: 32px; height: 32px;
  background: linear-gradient(155deg, var(--navy-light), var(--ink) 65%);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #f5f3f0;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 2px 6px rgba(26,18,16,0.25);
}

.auth-logo-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.03em;
}

/* ── Tab Switcher ── */
.auth-tabs {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 4px;
  margin-bottom: 28px;
  gap: 4px;
}

.auth-tab {
  flex: 1;
  padding: 8px 0;
  background: none;
  border: none;
  border-radius: var(--r-pill);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  letter-spacing: -0.01em;
}

.auth-tab.active {
  background: var(--bg-card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.auth-tab:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* ── Panels ── */
.auth-panel { display: none; }
.auth-panel.active { display: block; }

/* ── Heading ── */
.auth-heading {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 0.84rem;
  color: var(--ink-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ── Form ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.field input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-input);
  padding: 0.72rem 1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field input::placeholder { color: var(--ink-muted); }

.field input:hover { border-color: var(--border-hover); }

.field input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--teal-glow);
  background: var(--bg-card);
}

/* ── Checkbox row ── */
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
  margin-top: 2px;
}

.check-row input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--teal);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Submit Button ── */
.btn-submit {
  width: 100%;
  padding: 0.78rem 1rem;
  background: var(--teal);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.12s;
  letter-spacing: 0.01em;
  margin-top: 4px;
}

.btn-submit:hover {
  background: var(--teal-dim);
  box-shadow: var(--glow-teal);
  transform: translateY(-1px);
}

.btn-submit:active { transform: scale(0.985); }

.btn-submit:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* ── Status Message ── */
.auth-msg {
  font-size: 0.78rem;
  min-height: 0;
  text-align: center;
  border-radius: var(--r-sm);
  transition: all 0.2s;
}

.auth-msg:not(:empty) { padding: 8px 12px; }
.auth-msg.error   { color: var(--red);   background: rgba(220,38,38,0.07); }
.auth-msg.success { color: var(--green); background: rgba(5,150,105,0.07); }

/* ── Links Row ── */
.links-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

.links-row a {
  font-size: 0.8rem;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.18s;
}

.links-row a:hover { color: var(--ink-soft); }

.links-row a:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
  border-radius: 3px;
}

.links-row-note {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* Highlight the action link (Log In / Sign Up) */
#switch-to-login {
  color: var(--teal);
  font-weight: 600;
}

#switch-to-login:hover { color: var(--teal-dim); }

/* ══════════════════════════════════════════
   WORKSPACE GATE
   Shown after signup / on login without a
   workspace. Reuses .auth-tabs, .auth-panel,
   .auth-form, .field, .btn-submit, .auth-msg,
   .links-row so it feels like part of the same
   flow rather than a bolted-on step.
══════════════════════════════════════════ */

/* Success banner after account creation */
.gate-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(5,150,105,0.08);
  color: var(--green);
  border: 1px solid rgba(5,150,105,0.18);
  border-radius: var(--r-input);
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 18px;
  animation: cardReveal 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.gate-banner i { font-size: 1rem; flex-shrink: 0; }

/* Auth tab icons (Create / Join) */
.auth-tab { display: flex; align-items: center; justify-content: center; gap: 6px; }
.auth-tab i { font-size: 0.95rem; }

/* Inline hint under the workspace fields */
.gate-hint {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--ink-muted);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  margin-top: 2px;
}

.gate-hint i { font-size: 0.95rem; margin-top: 1px; flex-shrink: 0; color: var(--teal); }

/* Workspace join code input — spaced out like a code */
.field input.code-input {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  text-align: center;
}

.field input.code-input::placeholder {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}

/* Centered links row variant (used under signup / gate panels) */
.links-row--center { justify-content: center; }

.gate-footer { margin-top: 8px; }

#gateSignedInAs { font-size: 0.78rem; }

#gateSignOut {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

#gateSignOut:hover { color: var(--red); }

/* Loading spinner used inside buttons while a request is in flight */
.btn-submit .bx-spin,
.pill-btn .bx-spin { animation: btnSpin 0.7s linear infinite; }

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

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 480px) {
  .auth-card { padding: 32px 24px 28px; }
  .auth-card::before { left: 24px; right: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  .btn-submit .bx-spin, .pill-btn .bx-spin { animation: none; }
}