/* Backstage App â Global Styles */

:root {
  /* Forest (dark) â default */
  --bg: #1b2620;
  --bg-raised: #222e27;
  --bg-sunk: #172019;
  --ink: #eae3d2;
  --ink-mute: rgba(234,227,210,0.62);
  --ink-faint: rgba(234,227,210,0.38);
  --hair: rgba(234,227,210,0.14);
  --hair-strong: rgba(234,227,210,0.28);
  --accent: #b8a3d9;
  --alex: #c9a86a;
  --lindsey: #b8c49a;
  --joint: #a7b2a0;
  --warn: #e6a66a;
  --danger: #e07b5b;
  --ok: #9db58a;

  --font-display: 'Cormorant Garamond', 'Cormorant', Georgia, serif;
  --font-sans: 'Inter', 'SÃ¶hne', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="light"] {
  --bg: #eee8d8;
  --bg-raised: #f5efde;
  --bg-sunk: #e4ddc8;
  --ink: #1e2820;
  --ink-mute: rgba(30,40,32,0.62);
  --ink-faint: rgba(30,40,32,0.38);
  --hair: rgba(30,40,32,0.14);
  --hair-strong: rgba(30,40,32,0.28);
  --accent: #5a4a7a;
  --alex: #8a6a2e;
  --lindsey: #5f7a44;
  --joint: #4f5f4a;
  --warn: #a6661f;
  --danger: #a8442b;
  --ok: #4e6e3e;
}

*, *::before, *::after { box-sizing: border-box; }

html, body, #root {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

button {
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; }

input, select, textarea {
  font: inherit;
  color: inherit;
  background: transparent;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--hair-strong); border-radius: 2px; }

/* Utility */
.micro {
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-faint);
}

.hair { height: 1px; background: var(--hair); width: 100%; }

/* App shell */
#root {
  display: flex;
  flex-direction: column;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100%;
  min-height: 100dvh;
  position: relative;
}

/* Screens scroll container */
.screen {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Bottom nav */
.bottom-nav {
  flex-shrink: 0;
  border-top: 1px solid var(--hair);
  display: flex;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 8px)) 10px;
  background: var(--bg);
  position: sticky;
  bottom: 0;
  z-index: 100;
}

.bottom-nav button {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--ink-faint);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 10px 4px;
  position: relative;
  transition: color 0.15s;
}

.bottom-nav button.active {
  color: var(--ink);
}

.bottom-nav button.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  background: var(--accent);
}

/* Cards */
.card {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--hair);
  background: var(--bg-raised);
}

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}

/* Auth screen */
.auth-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 40px 24px;
  text-align: center;
}

.auth-screen input {
  width: 100%;
  max-width: 280px;
  padding: 14px 16px;
  border: 1px solid var(--hair-strong);
  border-radius: 10px;
  font-size: 16px;
  text-align: center;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.2s;
}

.auth-screen input:focus {
  border-color: var(--accent);
}

.auth-screen input::placeholder {
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

.auth-screen .auth-btn {
  width: 100%;
  max-width: 280px;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  margin-top: 4px;
  transition: opacity 0.2s;
}

.auth-screen .auth-btn:disabled {
  opacity: 0.4;
}

.auth-screen .auth-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 12px;
}

/* Day switcher */
.day-switcher {
  display: flex;
  gap: 6px;
  padding: 4px 12px 10px;
}

.day-switcher button {
  flex: 1;
  padding: 8px 6px;
  border-radius: 8px;
  border: 1px solid var(--hair);
  background: transparent;
  color: var(--ink-mute);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  transition: all 0.15s;
}

.day-switcher button.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* Filter pills */
.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pills button {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: transparent;
  color: var(--ink-mute);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  transition: all 0.15s;
}

.filter-pills button.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* Scope toggle */
.scope-toggle {
  display: inline-flex;
  border: 1px solid var(--hair);
  border-radius: 999px;
  overflow: hidden;
}

.scope-toggle button {
  padding: 5px 10px;
  border: none;
  background: transparent;
  color: var(--ink-mute);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  transition: all 0.15s;
}

.scope-toggle button.active {
  background: var(--ink);
  color: var(--bg);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.25s ease-out;
}

/* Loading spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--hair);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}