/* RetireOdds design tokens + base + auth pages.
   Colors and type are lifted verbatim from the RetireOdds Dashboard mock:
   Space Grotesk (UI) + JetBrains Mono (numerals), green accent, fintech-clean. */

:root {
  --bg: #f3f2ee;
  --sidebar: #fbfaf7;
  --panel: #ffffff;
  --panel-2: #faf9f6;
  --border: #e7e4dc;
  --text: #1b2421;
  --text-2: #6a716c;
  --muted: #9aa09a;
  --accent: #3f8f63;
  --accent-soft: #eaf3ee;
  --warn: #bd8836;
  --grid: #eeece6;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 28px rgba(0, 0, 0, 0.06);
}

.dark {
  --bg: #0f1417;
  --sidebar: #12181b;
  --panel: #161d20;
  --panel-2: #1b2328;
  --border: #28312f;
  --text: #e9efea;
  --text-2: #9aa6a0;
  --muted: #67726c;
  --accent: #4ad29a;
  --accent-soft: rgba(74, 210, 154, 0.15);
  --warn: #d6a24a;
  --grid: #222b2d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 38px rgba(0, 0, 0, 0.5);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.28);
  border-radius: 6px;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- auth pages ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 400px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeUp 0.4s ease both;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 6px;
}
.auth-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-brand span {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.auth-sub {
  color: var(--text-2);
  font-size: 14.5px;
  margin: 2px 0 22px;
}
.auth-box {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 26px;
}
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  font-family: inherit;
  font-size: 14.5px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.btn-primary {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
}
.btn-primary:hover {
  filter: brightness(1.05);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
}
.auth-error {
  background: rgba(214, 87, 69, 0.12);
  color: #c0392b;
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 13px;
  margin-bottom: 14px;
}
.auth-foot {
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--text-2);
  text-align: center;
}
.auth-foot a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.auth-foot a:hover {
  text-decoration: underline;
}

/* =========================================================================
   Responsive: make the SPA usable on mobile without touching desktop.
   Everything here is gated behind the breakpoint, so desktop is unaffected.
   The grid-template selectors match the browser-normalized inline styles
   and are unique to layout rows (not the multi-column data tables).
   ========================================================================= */
.np-hamburger { display: none; }
.np-overlay { display: none; }

/* App shell sizing: match the *visible* viewport (dvh) so mobile address-bar
   chrome doesn't make the page taller than the screen and rubber-band. The
   scroller keeps its overscroll to itself instead of chaining to the body. */
.np-root { height: 100vh; height: 100dvh; }
.np-main { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

@media (max-width: 768px) {
  /* sidebar becomes an off-canvas drawer */
  .np-aside {
    position: fixed !important;
    top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 80;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
  }
  .np-aside.open { transform: translateX(0); }
  .np-overlay { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 70; }
  .np-hamburger { display: inline-flex !important; }
  .np-hide-sm { display: none !important; }
  .np-topbar { padding: 0 14px !important; }
  .np-main { padding: 14px !important; }

  /* KPI rows -> 2 up; everything else stacks */
  [style*="grid-template-columns: repeat(4, 1fr)"] { grid-template-columns: 1fr 1fr !important; }
  [style*="grid-template-columns: repeat(3, 1fr)"],
  [style*="grid-template-columns: 1fr 2fr"],
  [style*="grid-template-columns: 2fr 1fr"],
  [style*="grid-template-columns: 1.4fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }

  /* wide data tables scroll horizontally instead of squishing */
  .np-xscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
