/* frontend/css/app.css */
:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface2: #252525;
  --accent: #ff6b35;
  --accent-dim: #cc5528;
  --text: #ffffff;
  --text-muted: #888888;
  --success: #4ade80;
  --warning: #facc15;
  --danger: #f87171;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 0 80px;
}

/* Layout */
.page { padding: 20px 16px; }
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 8px;
}
.page-title { font-size: 20px; font-weight: 700; }

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

/* Streak widget */
.streak-widget {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin-bottom: 12px;
}
.streak-count {
  font-size: 36px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.streak-label { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.streak-tier { font-size: 14px; font-weight: 600; color: var(--accent); margin-top: 8px; }

.streak-widget.warning .streak-count { color: var(--warning); }
.streak-widget.warning .streak-tier { color: var(--warning); }
.streak-widget.recovery .streak-count { color: var(--text-muted); }
.streak-widget.recovery .streak-tier { color: var(--text-muted); }

/* Week grid */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 14px;
}
.week-day {
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.week-day.done { background: var(--accent); }
.week-day.today { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Entry points */
.entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.entry-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.entry-card .entry-icon { font-size: 28px; margin-bottom: 8px; }
.entry-card .entry-title { font-size: 16px; font-weight: 600; }
.entry-card .entry-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Buttons */
.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:active { background: var(--accent-dim); }
.btn-secondary { background: var(--surface2); color: var(--text); }

/* Session type buttons */
.session-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.session-btn {
  padding: 18px 12px;
  border: 2px solid var(--surface2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.session-btn.selected {
  border-color: var(--accent);
  background: rgba(255,107,53,0.1);
  color: var(--accent);
}

/* Form */
.form-group { margin-bottom: 16px; }
.form-label { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; display: block; }
.form-input {
  width: 100%;
  padding: 14px;
  background: var(--surface2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
}
.form-input:focus { outline: none; border-color: var(--accent); }

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; }
.toast.error { background: var(--danger); color: #fff; }

/* Recovery banner */
.recovery-banner {
  background: rgba(248,113,113,0.1);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.recovery-banner strong { color: var(--danger); }

/* Warning banner */
.warning-banner {
  background: rgba(250,204,21,0.1);
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.warning-banner strong { color: var(--warning); }

/* Nav */
.nav-back {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
