/* App-specific styles — extends theme.css design tokens */

/* ===== SHARED BUTTONS ===== */
.btn-primary {
  background: var(--accent);
  color: #000;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
  display: inline-block;
}
.btn-primary:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn-primary.btn-full { width: 100%; text-align: center; }

.btn-accent {
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
}
.btn-accent:hover { background: rgba(245,158,11,0.2); }
.btn-accent.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-accent.btn-full { width: 100%; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  text-decoration: none;
}
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }
.btn-ghost.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--bg);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}
.auth-title {
  font-family: var(--font-head);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.auth-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-footer { text-align: center; margin-top: 1.25rem; font-size: 0.875rem; color: var(--text-muted); }
.auth-footer a { color: var(--accent); text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.form-group input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.7rem 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--accent); }

.alert { padding: 0.75rem 1rem; border-radius: var(--radius); font-size: 0.875rem; margin-bottom: 0.75rem; }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }

/* ===== ONBOARDING ===== */
.onboarding-page {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4rem 1rem 2rem;
  background: var(--bg);
}
.onboarding-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 520px;
}
.onboarding-step { font-size: 0.75rem; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.75rem; }
.onboarding-title { font-family: var(--font-head); font-size: 1.8rem; font-weight: 700; margin-bottom: 0.5rem; }
.onboarding-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; line-height: 1.5; }
.onboarding-add-form { margin-bottom: 1.25rem; }
.onboarding-input-row { display: flex; gap: 0.5rem; }
.onboarding-input-row input, #new-habit-name {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.6rem 0.9rem;
  outline: none;
}
.onboarding-input-row input:focus, #new-habit-name:focus { border-color: var(--accent); }

.habit-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.habit-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  color: var(--text);
}

.onboarding-suggestions { margin-top: 0.5rem; }
.suggestions-label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.6rem; }
.suggestions-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.suggestion-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.suggestion-chip:hover { color: var(--text); border-color: var(--border-accent); }

/* ===== APP SHELL ===== */
.app-body { background: var(--bg); min-height: 100vh; }
.app-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: rgba(10,10,12,0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.app-nav__inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.app-nav__links { display: flex; gap: 1.5rem; flex: 1; }
.app-nav__links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s;
}
.app-nav__links a.active, .app-nav__links a:hover { color: var(--text); border-bottom-color: var(--accent); }
.app-main { padding-top: 60px; max-width: 1100px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* ===== DASHBOARD ===== */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  padding: 2rem 0;
}
@media (max-width: 800px) {
  .dash-grid { grid-template-columns: 1fr; }
}

.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.dash-greeting { font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; }
.dash-date { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.2rem; }
.checkin-progress { text-align: right; }
.checkin-count { font-family: var(--font-head); font-size: 1.8rem; font-weight: 700; color: var(--accent); display: block; }
.checkin-label { font-size: 0.75rem; color: var(--text-muted); }

.checkins-grid { display: flex; flex-direction: column; gap: 0.875rem; margin-bottom: 1.5rem; }
.checkin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.2s;
}
.checkin-card--active { border-color: var(--border-accent); background: var(--surface-2); }
.checkin-card--done { opacity: 0.85; }
.checkin-card__header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.checkin-icon { font-size: 1.1rem; }
.checkin-label-text { font-weight: 600; font-size: 0.9rem; flex: 1; }
.checkin-badge {
  font-size: 0.75rem;
  color: #4ade80;
  background: rgba(74,222,128,0.1);
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 100px;
  padding: 0.15rem 0.6rem;
}
.checkin-content {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}
.checkin-input-area { display: flex; flex-direction: column; gap: 0.6rem; }
.checkin-input-area textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.875rem;
  padding: 0.75rem;
  resize: vertical;
  min-height: 80px;
  outline: none;
}
.checkin-input-area textarea:focus { border-color: var(--accent); }

/* Brief cards */
.brief-preview-card {
  background: var(--surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.brief-preview__header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 0.9rem;
}
.brief-icon { font-size: 1.1rem; }
.brief-preview__header a { margin-left: auto; }
.brief-preview__content {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.brief-preview__content h3 { color: var(--text); font-family: var(--font-head); font-size: 0.95rem; margin: 0.75rem 0 0.4rem; }
.brief-preview__content strong { color: var(--text); }

.brief-empty-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}
.brief-empty__icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.brief-empty-card h3 { font-family: var(--font-head); font-size: 1.1rem; margin-bottom: 0.5rem; }
.brief-empty-card p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; }

/* ===== HABITS PANEL ===== */
.habits-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.habits-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.habits-card__header h2 { font-family: var(--font-head); font-size: 1rem; font-weight: 600; }
.habits-empty { color: var(--text-dim); font-size: 0.875rem; padding: 0.5rem 0; }
.habits-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.habit-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.habit-row:hover { background: var(--surface-2); }
.habit-row--done .habit-name { text-decoration: line-through; color: var(--text-dim); }
.habit-toggle { background: none; border: none; cursor: pointer; padding: 0; display: flex; flex-shrink: 0; }
.habit-info { flex: 1; min-width: 0; }
.habit-name { display: block; font-size: 0.875rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.habit-streak { font-size: 0.75rem; color: var(--accent); }
.habit-delete {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.habit-row:hover .habit-delete { opacity: 1; }
.habit-delete:hover { color: #ef4444; }

/* Audit trigger card */
.audit-trigger-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}
.audit-trigger__label { font-family: var(--font-head); font-size: 0.95rem; font-weight: 600; margin-bottom: 0.3rem; }
.audit-trigger__sub { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.875rem; line-height: 1.4; }
.audit-status { margin-top: 0.6rem; font-size: 0.8rem; min-height: 1.2em; }

/* ===== BRIEFS PAGE ===== */
.briefs-page { padding: 2rem 0; max-width: 700px; }
.briefs-title { font-family: var(--font-head); font-size: 1.8rem; font-weight: 700; margin-bottom: 0.4rem; }
.briefs-sub { color: var(--text-muted); margin-bottom: 2rem; }
.briefs-list { display: flex; flex-direction: column; gap: 1.25rem; }
.brief-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.brief-card--latest { border-color: var(--border-accent); }
.brief-card__meta { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.brief-date { font-family: var(--font-head); font-size: 0.9rem; color: var(--text-muted); }
.brief-badge-latest { font-size: 0.7rem; color: var(--accent); background: var(--accent-dim); border: 1px solid var(--border-accent); border-radius: 100px; padding: 0.15rem 0.6rem; font-weight: 600; }
.brief-card__content { font-size: 0.875rem; color: var(--text-muted); line-height: 1.7; }
.brief-card__content h3 { color: var(--text); font-family: var(--font-head); font-size: 0.95rem; margin: 0.75rem 0 0.35rem; }
.brief-card__content strong { color: var(--text); }

/* markdown-content shared styles */
.markdown-content hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.markdown-content em { color: var(--text-dim); font-style: italic; }
