/* ============================================
   PANTRY — Design System
   Dark, domestic, premium-but-warm
   ============================================ */

:root {
  /* Backgrounds */
  --bg-primary: #0E0E0E;
  --bg-secondary: #181818;
  --bg-tertiary: #222222;
  --border: #2E2E2E;

  /* Text */
  --text-primary: #F5F0E8;
  --text-secondary: #8C8680;
  --text-disabled: #4A4845;

  /* Accent */
  --accent: #C8A97E;

  /* Status */
  --status-fresh: #5A8A6A;
  --status-warning: #C4923A;
  --status-urgent: #A85450;
  --status-recurring: #5A7A9E;

  /* Fonts */
  --font-display: 'Fraunces', Georgia, serif;
  --font-ui: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'DM Mono', 'SF Mono', monospace;

  /* Radii */
  --radius-card: 16px;
  --radius-button: 12px;
  --radius-pill: 20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #0a0a0a;
  font-family: var(--font-ui);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; }

/* ============================================
   STAGE
   ============================================ */
.stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  gap: 1rem;
}

.hint {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0;
}

/* ============================================
   DEV SCREEN PICKER (remove for production)
   ============================================ */
.dev-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  max-width: 640px;
  padding: 12px 16px;
  background: rgba(24, 24, 24, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 1rem;
}

.dev-picker__label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  width: 100%;
  text-align: center;
  margin-bottom: 4px;
}

.dev-picker button {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all 0.15s;
}

.dev-picker button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================
   PHONE FRAME
   ============================================ */
.phone-frame {
  width: 412px;
  height: 840px;
  background: #1a1a1a;
  border-radius: 48px;
  padding: 11px;
  border: 1px solid #2a2a2a;
  position: relative;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

.phone-notch {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 32px;
  background: #000;
  border-radius: 20px;
  z-index: 50;
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  border-radius: 38px;
  overflow: hidden;
  position: relative;
}

/* ============================================
   STATUS BAR
   ============================================ */
.status-bar {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px 0 32px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.status-icons {
  display: flex;
  gap: 5px;
  align-items: center;
}

.status-icons svg { fill: currentColor; }

/* ============================================
   SCREEN CONTENT
   ============================================ */
.screen-content {
  height: calc(100% - 50px - 76px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 20px;
  scrollbar-width: none;
}

.screen-content::-webkit-scrollbar { display: none; }

/* ============================================
   TYPOGRAPHY
   ============================================ */
.display-h {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.mono { font-family: var(--font-mono); }

.label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  display: inline-block;
  font-weight: 500;
}

.badge--urgent  { background: rgba(168, 84, 80, 0.15); color: var(--status-urgent); }
.badge--warning { background: rgba(196, 146, 58, 0.15); color: var(--status-warning); }
.badge--fresh   { background: rgba(90, 138, 106, 0.15); color: var(--status-fresh); }
.badge--recurring { background: rgba(90, 122, 158, 0.15); color: var(--status-recurring); }
.badge--accent  { background: rgba(200, 169, 126, 0.15); color: var(--accent); }

/* ============================================
   BUTTONS
   ============================================ */
.primary-btn {
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-button);
  height: 52px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius-button);
  height: 44px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.ghost-btn--danger {
  border-color: var(--status-urgent);
  color: var(--status-urgent);
}

.fab {
  position: absolute;
  bottom: 96px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 28px;
  background: var(--accent);
  border: none;
  color: var(--bg-primary);
  font-size: 24px;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-ui);
}

/* ============================================
   INPUTS
   ============================================ */
.input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  height: 48px;
  padding: 0 14px;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  width: 100%;
  outline: none;
}

.input:focus { border-color: var(--accent); }

/* ============================================
   ROW + AVATARS + THUMBS
   ============================================ */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  color: var(--bg-primary);
}

.avatar--sm { width: 22px; height: 22px; font-size: 9px; }
.avatar--md { width: 24px; height: 24px; font-size: 10px; }
.avatar--lg { width: 48px; height: 48px; font-size: 16px; }

.thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg-tertiary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* ============================================
   CHECKBOX
   ============================================ */
.checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: transparent;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
}

/* ============================================
   BOTTOM NAV
   ============================================ */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 76px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding-top: 12px;
}

.nav-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  color: var(--text-disabled);
  font-size: 10px;
  font-weight: 500;
  transition: color 0.15s;
}

.nav-btn.active { color: var(--accent); }
.nav-btn:hover  { color: var(--text-secondary); }
.nav-btn.active:hover { color: var(--accent); }

/* ============================================
   TABS
   ============================================ */
.tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ============================================
   SAVED ITEM CARD
   ============================================ */
.saved-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  padding: 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.saved-card:hover { border-color: var(--accent); }

.saved-card__photo {
  height: 60px;
  background: var(--bg-secondary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 8px;
}

/* ============================================
   TOGGLE SWITCH
   ============================================ */
.toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 20px;
  transition: 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 2px;
  top: 2px;
  background: var(--text-primary);
  border-radius: 50%;
  transition: 0.2s;
}

.toggle.is-on .toggle-slider { background: var(--accent); }
.toggle.is-on .toggle-slider::before { transform: translateX(16px); }

/* ============================================
   BACK BUTTON
   ============================================ */
.back-btn {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.back-btn:hover { border-color: var(--accent); color: var(--accent); }

.back-btn--floating {
  position: absolute;
  top: 60px;
  left: 28px;
  background: rgba(14, 14, 14, 0.7);
  backdrop-filter: blur(8px);
  z-index: 5;
}

/* ============================================
   ONBOARDING
   ============================================ */
.onboarding-skip {
  position: absolute;
  top: 60px;
  right: 28px;
  z-index: 10;
}

.link-btn-secondary {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font-ui);
  padding: 4px 8px;
}

.link-btn-secondary:hover { color: var(--text-primary); }

/* ============================================
   UTIL
   ============================================ */
.spacer-sm { height: 16px; }
.spacer-md { height: 32px; }
.spacer-lg { height: 80px; }
