/* ============================================================
   HypothesisOS — App-specific styles
   (Supplements theme.css — uses same design tokens)
   ============================================================ */

/* ── Auth pages ──────────────────────────────────────────────── */
.auth-page {
  background: var(--ivory);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-container {
  width: 100%;
  max-width: 420px;
}

.auth-header {
  text-align: center;
  margin-bottom: 40px;
}

.auth-logo {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--midnight);
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
}

.auth-tagline {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 300;
}

.auth-card {
  background: white;
  border: 1px solid var(--warm-gray);
  border-radius: 8px;
  padding: 40px;
  box-shadow: 0 4px 24px rgba(12, 27, 51, 0.08);
}

.auth-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: var(--midnight);
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.6;
}

.auth-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 6px;
  padding: 12px 16px;
  color: #DC2626;
  font-size: 14px;
  margin-bottom: 20px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--midnight);
}

.form-hint {
  font-weight: 400;
  color: var(--text-muted);
}

.form-group input {
  padding: 12px 16px;
  border: 1.5px solid var(--warm-gray);
  border-radius: 6px;
  font-size: 15px;
  font-family: var(--font-body);
  color: var(--midnight);
  background: white;
  transition: border-color 0.15s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--amber);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--midnight);
  color: var(--text-light);
  padding: 14px 24px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  font-family: var(--font-body);
}

.btn-primary:hover { background: var(--navy); }
.btn-large { padding: 16px 32px; font-size: 16px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  color: var(--midnight);
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1.5px solid var(--warm-gray);
  cursor: pointer;
  transition: border-color 0.15s;
  font-family: var(--font-body);
}

.btn-secondary:hover { border-color: var(--midnight); }

.btn-text {
  background: none;
  border: none;
  color: var(--amber-dark);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
  padding: 0;
}

.btn-text:hover { color: var(--midnight); }

.auth-footer-text {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 20px;
}

.auth-footer-text a {
  color: var(--amber-dark);
  text-decoration: none;
  font-weight: 500;
}

/* ── Onboarding shell ────────────────────────────────────────── */
.onboarding-page { background: var(--ivory); }

.onboarding-shell {
  display: flex;
  min-height: 100vh;
}

.onboarding-nav {
  width: 240px;
  flex-shrink: 0;
  background: var(--midnight);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.nav-brand {
  margin-bottom: 48px;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--amber);
  text-decoration: none;
}

.nav-steps {
  list-style: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  color: rgba(247, 245, 240, 0.4);
  font-size: 14px;
  transition: background 0.15s;
}

.nav-step.active {
  background: rgba(212, 168, 67, 0.15);
  color: var(--amber);
}

.nav-step.done { color: rgba(247, 245, 240, 0.25); }

.nav-step .step-num {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.nav-step .step-label {
  font-size: 13px;
  font-weight: 400;
}

.nav-user {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.user-initial {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--midnight);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}

.nav-logout {
  color: rgba(247, 245, 240, 0.35);
  font-size: 12px;
  text-decoration: none;
  transition: color 0.15s;
}

.nav-logout:hover { color: rgba(247, 245, 240, 0.65); }

.onboarding-main {
  flex: 1;
  overflow-y: auto;
}

.onboarding-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 48px;
}

.walkthrough-header { margin-bottom: 48px; }

.walkthrough-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.walkthrough-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 600;
  color: var(--midnight);
  margin-bottom: 12px;
  line-height: 1.2;
}

.walkthrough-subtitle {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 560px;
}

/* Framework cards */
.framework-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

.framework-card {
  background: white;
  border: 1px solid var(--warm-gray);
  border-radius: 8px;
  padding: 28px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  transition: box-shadow 0.2s;
}

.framework-card:hover { box-shadow: 0 4px 20px rgba(12, 27, 51, 0.08); }

.fc-icon {
  width: 48px;
  height: 48px;
  background: var(--midnight);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber);
  flex-shrink: 0;
}

.fc-body h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--midnight);
  margin-bottom: 6px;
}

.fc-body p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Callout */
.walkthrough-callout {
  background: var(--midnight);
  border-radius: 8px;
  padding: 32px 36px;
  margin-bottom: 40px;
  position: relative;
}

.callout-mark {
  font-family: var(--font-display);
  font-size: 64px;
  color: var(--amber);
  line-height: 1;
  margin-bottom: 8px;
}

.walkthrough-callout p {
  font-size: 17px;
  color: rgba(247, 245, 240, 0.75);
  line-height: 1.7;
  font-style: italic;
}

.walkthrough-callout em { color: var(--amber); font-style: italic; }

.walkthrough-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.action-hint {
  font-size: 13px;
  color: var(--text-muted);
}

/* Sample problem card */
.sample-problem-card {
  background: white;
  border: 1px solid var(--warm-gray);
  border-radius: 8px;
  padding: 32px;
  margin-bottom: 32px;
}

.sp-status {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber-dark);
  margin-bottom: 16px;
}

.sp-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--midnight);
  margin-bottom: 12px;
  line-height: 1.3;
}

.sp-context {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.sp-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-tag {
  background: var(--ivory);
  border: 1px solid var(--warm-gray);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

/* Hypothesis cards */
.hypothesis-list { display: flex; flex-direction: column; gap: 16px; }

.hypothesis-card {
  background: white;
  border: 1px solid var(--warm-gray);
  border-radius: 8px;
  padding: 24px;
}

.priority-high { border-left: 3px solid var(--amber); }
.priority-medium { border-left: 3px solid var(--text-muted); }

.h-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber-dark);
  margin-bottom: 10px;
}

.h-text {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--midnight);
  margin-bottom: 16px;
}

.h-evidence {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.evidence-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.evidence-col p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Ready callout */
.ready-callout {
  background: white;
  border: 1px solid var(--warm-gray);
  border-radius: 8px;
  padding: 32px;
  margin-bottom: 32px;
}

.ready-items { display: flex; flex-direction: column; gap: 24px; }

.ready-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.ready-check {
  width: 28px;
  height: 28px;
  background: var(--amber);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--midnight);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.ready-item strong { font-size: 15px; color: var(--midnight); display: block; margin-bottom: 4px; }
.ready-item p { font-size: 13px; color: var(--text-muted); }

/* Skip tour link */
.walkthrough-skip {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--warm-gray);
}

.skip-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.skip-link:hover { color: var(--midnight); }

/* ── New Problem Modal ───────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 27, 51, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-box {
  background: white;
  border-radius: 10px;
  padding: 40px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 60px rgba(12, 27, 51, 0.3);
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--midnight);
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--midnight); }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.modal-box .form-group {
  margin-bottom: 20px;
}

.modal-box textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--warm-gray);
  border-radius: 6px;
  font-size: 15px;
  font-family: var(--font-body);
  color: var(--midnight);
  background: white;
  resize: vertical;
  transition: border-color 0.15s;
}
.modal-box textarea:focus {
  outline: none;
  border-color: var(--amber);
}

/* ── Dashboard ────────────────────────────────────────────────── */
.dashboard-page { background: var(--ivory); }

.topbar {
  background: white;
  border-bottom: 1px solid var(--warm-gray);
  padding: 0 40px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 48px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-brand { flex-shrink: 0; }

.topbar-logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--midnight);
  text-decoration: none;
}

.topbar-nav { display: flex; gap: 32px; }

.topbar-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
  padding: 22px 0;
}

.topbar-link:hover,
.topbar-link.active { color: var(--midnight); }

.topbar-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-initial-lg {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--midnight);
  color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
}

.user-name {
  font-size: 14px;
  color: var(--midnight);
  font-weight: 500;
}

.topbar-logout {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.topbar-logout:hover { color: var(--midnight); }

.dashboard-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 40px;
}

.dashboard-section { margin-bottom: 56px; }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: var(--midnight);
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

/* Problem cards grid */
.problems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.problem-card {
  background: white;
  border: 1px solid var(--warm-gray);
  border-radius: 8px;
  padding: 28px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.problem-card:hover {
  box-shadow: 0 4px 24px rgba(12, 27, 51, 0.1);
  border-color: var(--amber);
}

.pc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pc-status {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--amber-dark);
  background: rgba(212, 168, 67, 0.1);
  padding: 3px 10px;
  border-radius: 3px;
}

.pc-date {
  font-size: 12px;
  color: var(--text-muted);
}

.pc-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--midnight);
  line-height: 1.35;
}

.pc-context {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.pc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.pc-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.pc-arrow {
  font-size: 16px;
  color: var(--amber-dark);
}

/* Framework reference */
.framework-ref { }

.framework-steps-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.fsr-step {
  background: white;
  border: 1px solid var(--warm-gray);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.fsr-num {
  width: 32px;
  height: 32px;
  background: var(--amber);
  color: var(--midnight);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.fsr-step strong { font-size: 14px; color: var(--midnight); display: block; margin-bottom: 4px; }
.fsr-step p { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 64px 40px;
  background: white;
  border: 1px dashed var(--warm-gray);
  border-radius: 8px;
}

.empty-icon { color: var(--warm-gray); margin-bottom: 16px; display: flex; justify-content: center; }
.empty-state h3 { font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--midnight); margin-bottom: 8px; }
.empty-state p { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }

/* ── Problem detail ───────────────────────────────────────────── */
.problem-page { background: var(--ivory); }

.problem-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 40px;
}

.problem-header {
  background: var(--midnight);
  color: var(--text-light);
  border-radius: 12px;
  padding: 48px;
  margin-bottom: 40px;
}

.ph-status {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 16px;
}

.ph-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.5vw, 32px);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 16px;
  color: var(--text-light);
}

.ph-context {
  font-size: 15px;
  color: rgba(247, 245, 240, 0.65);
  line-height: 1.75;
  margin-bottom: 24px;
}

.ph-meta { display: flex; gap: 8px; flex-wrap: wrap; }

.meta-chip {
  background: rgba(247, 245, 240, 0.1);
  color: rgba(247, 245, 240, 0.7);
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
}

/* Framework progress */
.framework-progress {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 48px;
  background: white;
  border: 1px solid var(--warm-gray);
  border-radius: 8px;
  padding: 20px 28px;
}

.fp-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.fp-step.active .fp-num { background: var(--amber); color: var(--midnight); }
.fp-step.active span { color: var(--midnight); font-weight: 600; }

.fp-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ivory);
  border: 2px solid var(--warm-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-muted);
}

.fp-step span { font-size: 12px; color: var(--text-muted); }

.fp-line {
  flex: 0 0 40px;
  height: 2px;
  background: var(--warm-gray);
  margin-bottom: 22px;
}

/* Hypotheses section */
.hypotheses-section { }

.hs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.hs-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--midnight);
}

.hypothesis-card-full {
  background: white;
  border: 1px solid var(--warm-gray);
  border-radius: 8px;
  padding: 28px;
  margin-bottom: 16px;
}

.hcf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.h-priority {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 3px;
}

.h-priority.high { background: rgba(212, 168, 67, 0.1); color: var(--amber-dark); }
.h-priority.medium { background: var(--ivory); color: var(--text-muted); }

.h-date { font-size: 12px; color: var(--text-muted); }

.hcf-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--midnight);
  margin-bottom: 20px;
  line-height: 1.35;
}

.hcf-evidence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 16px;
}

.hcf-ev-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.hcf-ev p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

.hcf-actions { display: flex; justify-content: flex-end; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .onboarding-nav { display: none; }
  .onboarding-content { padding: 40px 24px; }
  .framework-cards { grid-template-columns: 1fr; }
  .framework-steps-row { grid-template-columns: 1fr 1fr; }
  .h-evidence { grid-template-columns: 1fr; }
  .hcf-evidence-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .topbar { padding: 0 20px; gap: 20px; }
  .topbar-nav { display: none; }
  .dashboard-main { padding: 32px 20px; }
  .framework-steps-row { grid-template-columns: 1fr; }
  .problem-header { padding: 28px; }
  .walkthrough-actions { flex-direction: column; align-items: flex-start; }
}