/* ==========================================================================
   DOWNBEAT — Shared auth/app styles
   ========================================================================== */

:root {
  --ink: #0a0908;
  --ink-soft: #151210;
  --ink-softer: #1d1a17;
  --bone: #f4f1e8;
  --bone-dim: #c8c2b1;
  --bone-faint: #8a8477;
  --flare: #f7a60a;
  --flare-dim: #a86f06;
  --crimson: #c1292e;
  --emerald: #4a8a3b;
  --line: rgba(244, 241, 232, 0.12);
  --line-strong: rgba(244, 241, 232, 0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--ink);
  color: var(--bone);
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: 10% 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
}
body::after {
  content: "";
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.96 0 0 0 0 0.94 0 0 0 0 0.91 0 0 0 0.18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 2;
  opacity: 0.3;
  mix-blend-mode: overlay;
}

main, header, footer { position: relative; z-index: 3; }

/* ---- Type ---------------------------------------------------------------- */
.display {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 0.88;
  text-transform: uppercase;
}
.serif {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  text-transform: none;
}
.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---- Nav ----------------------------------------------------------------- */
.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2.5rem;
  border-bottom: 1px solid var(--line);
}
.logo {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.logo .dot {
  width: 10px; height: 10px;
  background: var(--flare);
  border-radius: 50%;
  animation: pulse 1s cubic-bezier(.4,0,.6,1) infinite;
}
.topnav-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.topnav-right .mono {
  color: var(--bone-dim);
}
.topnav-right .mono .accent {
  color: var(--flare);
}

/* ---- Auth layout --------------------------------------------------------- */
.auth-shell {
  min-height: calc(100vh - 90px);
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 0;
}

.auth-visual {
  background: var(--ink-soft);
  border-right: 1px solid var(--line);
  padding: 4rem 3.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-visual::before {
  content: "";
  position: absolute;
  top: -50px; right: -50px;
  width: 260px; height: 260px;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.auth-visual::after {
  content: "";
  position: absolute;
  bottom: -80px; left: -80px;
  width: 300px; height: 300px;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.auth-eyebrow {
  color: var(--flare);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  position: relative;
}
.auth-eyebrow .bar { width: 30px; height: 2px; background: var(--flare); }

.auth-visual h1 {
  font-size: clamp(3rem, 5.5vw, 5.5rem);
  line-height: 0.88;
  margin-top: 1.5rem;
  position: relative;
}
.auth-visual h1 .flare { color: var(--flare); }
.auth-visual h1 .italic {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  text-transform: none;
  color: var(--bone-dim);
}

.auth-quote {
  position: relative;
  max-width: 340px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.15rem;
  color: var(--bone-dim);
  line-height: 1.5;
  border-left: 2px solid var(--flare);
  padding-left: 1rem;
}

.auth-form-wrap {
  padding: 4rem 3.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 560px;
}

.auth-header .mono { color: var(--bone-dim); margin-bottom: 0.6rem; }
.auth-header h2 {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900;
  font-size: clamp(2.5rem, 4.5vw, 4rem);
  line-height: 0.9;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.auth-header h2 .accent { color: var(--flare); }
.auth-header .subtitle {
  color: var(--bone-dim);
  font-size: 1rem;
  margin-bottom: 2.5rem;
  max-width: 400px;
}

/* ---- Form fields --------------------------------------------------------- */
.field {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}
.field label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin-bottom: 0.5rem;
}
.field input,
.field select,
.field textarea {
  background: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 0.95rem 1rem;
  color: var(--bone);
  font-family: 'Manrope', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s, background 0.2s;
  outline: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--flare);
  background: var(--ink);
}
.field input::placeholder { color: var(--bone-faint); }
.field .hint {
  font-size: 0.78rem;
  color: var(--bone-faint);
  margin-top: 0.4rem;
  font-family: 'Fraunces', serif;
  font-style: italic;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  padding: 1rem 1.6rem;
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:not(:disabled):hover { transform: translateY(-2px); }
.btn-primary { background: var(--flare); color: var(--ink); }
.btn-primary:not(:disabled):hover { background: #ffb41f; }
.btn-ghost {
  background: transparent;
  color: var(--bone);
  border: 1px solid var(--line-strong);
}
.btn-ghost:not(:disabled):hover { border-color: var(--flare); color: var(--flare); }
.btn-block { width: 100%; }

/* ---- Messaging ----------------------------------------------------------- */
.msg {
  padding: 0.9rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
  border-left: 3px solid var(--crimson);
  background: rgba(193, 41, 46, 0.08);
  color: var(--bone);
}
.msg.success {
  border-left-color: var(--emerald);
  background: rgba(74, 138, 59, 0.12);
}
.msg.info {
  border-left-color: var(--flare);
  background: rgba(247, 166, 10, 0.08);
}
.msg[hidden] { display: none; }

/* ---- Footer links -------------------------------------------------------- */
.auth-foot {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--line);
  color: var(--bone-dim);
  font-size: 0.88rem;
}
.auth-foot a { color: var(--flare); font-weight: 600; }
.auth-foot a:hover { text-decoration: underline; }

/* ---- Animations ---------------------------------------------------------- */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.9); }
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { padding: 2.5rem 1.5rem; min-height: 240px; }
  .auth-visual h1 { font-size: 2.4rem; }
  .auth-form-wrap { padding: 2.5rem 1.5rem; }
  .topnav { padding: 1rem 1.5rem; }
  .topnav-right .mono { display: none; }
  .field-row { grid-template-columns: 1fr; }
}

/* ==========================================================================
   ORG SWITCHER
   ========================================================================== */
.org-switcher {
  position: relative;
  display: inline-block;
}
.org-switcher-btn {
  display: flex; align-items: center; gap: 0.5rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--bone);
  padding: 0.5rem 0.9rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.08em;
  cursor: pointer;
  text-transform: uppercase;
  transition: border-color 0.2s;
}
.org-switcher-btn:hover { border-color: var(--flare); }
.org-switcher-label {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 800; font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: var(--flare);
  max-width: 180px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.org-switcher-arrow {
  color: var(--bone-dim);
  font-size: 0.8rem;
  line-height: 1;
}
.org-switcher-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 260px;
  background: var(--ink);
  border: 1px solid var(--line-strong);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  z-index: 50;
  padding: 0.4rem;
}
.org-switcher-heading {
  padding: 0.6rem 0.8rem 0.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem; letter-spacing: 0.15em;
  color: var(--bone-faint); text-transform: uppercase;
}
.org-switcher-item {
  display: block;
  width: 100%;
  background: transparent;
  border: none; color: var(--bone);
  text-align: left;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
}
.org-switcher-item:hover { background: var(--ink-soft); }
.org-switcher-item.active {
  background: rgba(247, 166, 10, 0.08);
  border-left: 2px solid var(--flare);
  padding-left: calc(0.8rem - 2px);
}
.org-switcher-item-name {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 800; font-size: 0.95rem;
  letter-spacing: 0.01em;
}
.org-switcher-item-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem; letter-spacing: 0.08em;
  color: var(--bone-dim);
  margin-top: 0.15rem;
  text-transform: uppercase;
}
.org-switcher-divider {
  height: 1px;
  background: var(--line);
  margin: 0.3rem 0;
}
