/* ─────────────────────────────────────────────────────────────
   style.css — watchful design system
   Soft, rounded, warm — a platform that feels safe
───────────────────────────────────────────────────────────── */

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Design tokens ────────────────────────────────────────── */
:root {
  /* Palette — soft & warm */
  --sage:          #8fad9b;
  --sage-light:    #e8f0eb;
  --sage-mid:      #c4d8ca;
  --sage-dark:     #5a8068;

  --blush:         #d4848a;
  --blush-light:   #f5e6e8;
  --blush-mid:     #e9b8bb;

  --cream:         #f7f3ee;
  --cream-dark:    #ede7dc;

  --stone:         #6b6560;
  --stone-light:   #9b948f;

  --amber:         #c4935a;
  --amber-light:   #f5e8d8;

  --slate:         #7a8fa6;
  --slate-light:   #e4ebf3;

  --red-soft:      #c06060;
  --red-light:     #f5e0e0;

  --text-main:     #3d3530;
  --text-muted:    #8a817b;

  /* Typography */
  --font-main:     'Nunito', system-ui, sans-serif;
  --font-accent:   'Lora', Georgia, serif;

  /* Shape */
  --radius-pill:   30px;
  --radius-card:   20px;
  --radius-inner:  12px;
  --radius-sm:     8px;

  /* Shadow */
  --shadow:        0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-hover:  0 6px 28px rgba(0, 0, 0, 0.10);

  /* Motion */
  --transition:    0.18s ease;
}

/* ── Screen-reader only ───────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Document ─────────────────────────────────────────────── */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--cream);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── App shell ────────────────────────────────────────────── */
.app {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

/* ── Header ───────────────────────────────────────────────── */
.header {
  text-align: center;
  margin-bottom: 2rem;
  padding-top: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.5rem;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--sage-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--sage-mid);
}

.logo-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--sage-dark);
}

.logo-wordmark {
  font-family: var(--font-accent);
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--text-main);
  letter-spacing: -0.015em;
}

.tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.25rem;
}

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab {
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 700;
  border: 1.5px solid var(--cream-dark);
  background: var(--cream);
  color: var(--stone-light);
  border-radius: var(--radius-pill);
  padding: 0.4rem 1rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.tab:hover {
  background: var(--sage-light);
  border-color: var(--sage-mid);
  color: var(--sage-dark);
}

.tab.active {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}

/* ── Panels ───────────────────────────────────────────────── */
.panel {
  display: none;
}

.panel.active {
  display: block;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius-card);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.card-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ── Compose area ─────────────────────────────────────────── */
.compose-area {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.obs-input {
  font-family: var(--font-main);
  font-size: 0.95rem;
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius-inner);
  padding: 0.85rem 1rem;
  resize: vertical;
  background: var(--cream);
  color: var(--text-main);
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
  line-height: 1.6;
}

.obs-input:focus {
  border-color: var(--sage-mid);
}

.obs-input::placeholder {
  color: var(--stone-light);
}

.submit-btn {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.75rem 2rem;
  background: var(--sage);
  color: #fff;
  cursor: pointer;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: 0.02em;
  transition: background var(--transition), box-shadow var(--transition);
}

.submit-btn:hover {
  background: var(--sage-dark);
  box-shadow: var(--shadow-hover);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ── Dilemma panel ────────────────────────────────────────── */
.dilemma-panel {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dilemma-intro {
  font-family: var(--font-accent);
  font-size: 0.95rem;
  color: var(--stone);
  font-style: italic;
  margin-bottom: 0.25rem;
  padding: 0.65rem 0.9rem;
  background: var(--amber-light);
  border-radius: var(--radius-inner);
  border-left: 3px solid var(--amber);
  line-height: 1.55;
}

.dilemma-btn {
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  line-height: 1.4;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.dilemma-btn:hover:not(:disabled) {
  transform: translateX(3px);
}

.dilemma-btn:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

/* Severity tiers */
.db-neutral {
  background: var(--sage-light);
  color: #3d6651;
  border-color: var(--sage-mid);
}
.db-neutral:hover:not(:disabled) {
  background: #d4e8da;
  border-color: var(--sage);
}

.db-caution {
  background: var(--amber-light);
  color: #7a5020;
  border-color: #dfc27a;
}
.db-caution:hover:not(:disabled) {
  background: #f0dba8;
  border-color: var(--amber);
}

.db-concern {
  background: var(--blush-light);
  color: #7a3040;
  border-color: var(--blush-mid);
}
.db-concern:hover:not(:disabled) {
  background: #f0ccd0;
  border-color: var(--blush);
}

.db-danger {
  background: var(--red-light);
  color: #7a2a2a;
  border-color: #e0b0b0;
}
.db-danger:hover:not(:disabled) {
  background: #f2caca;
  border-color: var(--red-soft);
}

/* ── Consequence box ──────────────────────────────────────── */
.consequence-box {
  display: none;
  border-radius: var(--radius-inner);
  padding: 0.8rem 1rem;
  font-size: 0.87rem;
  line-height: 1.6;
  border-left: 3px solid;
  animation: fadeIn 0.25s ease;
}

.cb-neutral  { background: var(--sage-light);  border-color: var(--sage);     color: #2e5040; }
.cb-warn     { background: var(--amber-light); border-color: var(--amber);    color: #6a4018; }
.cb-serious  { background: var(--blush-light); border-color: var(--blush);    color: #6a2030; }
.cb-critical { background: var(--red-light);   border-color: var(--red-soft); color: #5c1818; }

/* ── Feed list ────────────────────────────────────────────── */
.feed-list {
  list-style: none;
}

.feed-item {
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-inner);
  padding: 1rem 1.2rem;
  margin-bottom: 0.75rem;
  background: var(--cream);
  transition: box-shadow var(--transition);
}

.feed-item:last-child {
  margin-bottom: 0;
}

.feed-item:hover {
  box-shadow: var(--shadow);
}

.fi-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.fi-text {
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--text-main);
  flex: 1;
}

.fi-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-safe    { background: var(--sage-light);  color: var(--sage-dark); }
.badge-caution { background: var(--amber-light); color: #8a5a20;          }
.badge-concern { background: var(--blush-light); color: #8a3040;          }
.badge-watch   { background: var(--red-light);   color: #8a2020;          }

.fi-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

.fi-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.fi-action-btn {
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--cream-dark);
  background: #fff;
  color: var(--stone);
  border-radius: 20px;
  padding: 4px 14px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.fi-action-btn:hover:not(:disabled) {
  background: var(--sage-light);
  border-color: var(--sage-mid);
  color: var(--sage-dark);
}

.fi-action-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

/* ── Impact / counters ────────────────────────────────────── */
.counter-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.counter-card {
  background: var(--cream);
  border-radius: var(--radius-inner);
  padding: 0.85rem;
  text-align: center;
  border: 1px solid var(--cream-dark);
}

.counter-val {
  display: block;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.1;
}

.counter-lbl {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.2rem;
}

.cv-safe    { color: var(--sage);     }
.cv-caution { color: var(--amber);    }
.cv-concern { color: var(--blush);    }

/* ── Surveillance progress bar ────────────────────────────── */
.progress-bar-wrap {
  height: 7px;
  background: var(--cream-dark);
  border-radius: 4px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--sage) 0%, var(--amber) 55%, var(--blush) 80%, var(--red-soft) 100%);
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.pb-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
}

/* ── Revealed message ─────────────────────────────────────── */
.revealed-msg {
  font-family: var(--font-accent);
  font-size: 0.88rem;
  font-style: italic;
  color: var(--red-soft);
  margin-top: 1rem;
  opacity: 0;
  transition: opacity 0.6s ease;
  line-height: 1.6;
  text-align: center;
  padding: 0.5rem;
}

.revealed-msg.show {
  opacity: 1;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .app {
    padding: 1rem 0.75rem 3rem;
  }

  .logo-wordmark {
    font-size: 1.5rem;
  }

  .counter-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .counter-val {
    font-size: 1.3rem;
  }

  .tabs {
    flex-wrap: wrap;
  }
}

/* ── Profile fields (Act 2) ───────────────────────────────── */
.profile-fields {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-inner);
  padding: 1rem;
  margin-top: 0.25rem;
}

.profile-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 0.25rem;
}

.pf-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pf-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--stone);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pf-input {
  font-family: var(--font-main);
  font-size: 0.9rem;
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.8rem;
  background: #fff;
  color: var(--text-main);
  outline: none;
  transition: border-color var(--transition);
}

.pf-input:focus {
  border-color: var(--sage-mid);
}

.pf-input::placeholder {
  color: var(--stone-light);
}

.pf-check-row {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.pf-check-label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.86rem;
}

/* ── Feed visualization bar ───────────────────────────────── */
.fi-viz {
  margin: 0.6rem 0 0.4rem;
}

.viz-bar {
  display: flex;
  height: 7px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--cream-dark);
}

.vb-seg {
  height: 100%;
  transition: width 0.5s ease;
}

.vb-distress { background: var(--sage);     }
.vb-unsure   { background: var(--amber);    }
.vb-threat   { background: var(--red-soft); }

.viz-legend {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.35rem;
  font-size: 0.73rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  align-items: center;
}

.vl-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.vl-distress { background: var(--sage);     }
.vl-unsure   { background: var(--amber);    }
.vl-threat   { background: var(--red-soft); }

/* ── Dilemma skip note ────────────────────────────────────── */
.dilemma-skip-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 0.4rem 0.5rem;
  line-height: 1.5;
}
