/* App-specific styles for check-in and dashboard pages */

.app-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 2.5rem 6rem;
}

.app-eyebrow {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.app-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 0.75rem;
  line-height: 1.1;
}

.app-subtitle {
  font-size: 1rem;
  color: var(--fg-muted);
  margin-bottom: 2.5rem;
}

/* Check-in form card */
.checkin-form-card {
  background: var(--cream);
  border: 1px solid var(--border);
  padding: 2.5rem;
  margin-bottom: 3rem;
}

.symptom-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 1.5rem;
}

.symptom-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
  align-items: center;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.symptom-row:last-child { border-bottom: none; }

.symptom-name {
  display: block;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--fg);
  margin-bottom: 0.25rem;
}

.symptom-desc {
  display: block;
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

.symptom-slider-group { display: flex; flex-direction: column; gap: 0.5rem; }

.slider-track {
  display: flex;
  gap: 0.5rem;
}

.slider-btn {
  width: 48px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 2px;
}

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

.slider-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--cream);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.form-footer {
  display: flex;
  gap: 2rem;
  align-items: flex-end;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.notes-group { flex: 1; }

.notes-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

.optional { font-weight: 400; color: var(--fg-muted); }

textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.875rem;
  resize: none;
  transition: border-color 0.2s;
  border-radius: 2px;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.submit-btn {
  padding: 0.75rem 1.75rem;
  background: var(--green-deep);
  color: var(--cream);
  border: none;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 2px;
  white-space: nowrap;
}

.submit-btn:hover { background: var(--green-mid); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Recommendation box */
.recommendation-box {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg);
  border: 1px solid rgba(184, 113, 46, 0.25);
  border-radius: 2px;
}

.recommendation-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.recommendation-text {
  font-size: 0.9375rem;
  color: var(--fg);
  line-height: 1.65;
}

/* History section */
.history-section { }

.history-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.history-title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.875rem;
}

.history-card {
  background: var(--cream);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
}

.history-date {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 0.875rem;
  letter-spacing: 0.02em;
}

.history-scores {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}

.score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.score-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}

.score-val {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1;
}

.history-rec {
  font-size: 0.8125rem;
  color: var(--fg-muted);
  line-height: 1.55;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

.empty-history {
  padding: 3rem;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.9375rem;
  border: 1px dashed var(--border);
}

/* =====================
   SUBSCRIPTION / PAYWALL
   ===================== */

/* App header row with badge/link */
.app-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

/* Pro badge */
.pro-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  background: var(--green-deep);
  color: var(--cream);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 2px;
}

/* Upgrade link in nav */
.upgrade-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}
.upgrade-link:hover { color: var(--accent-dark); }

/* Upgrade CTA block */
.upgrade-cta {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg);
  border: 1px solid rgba(26, 58, 42, 0.15);
  border-radius: 2px;
}
.upgrade-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.upgrade-headline {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.2rem;
}
.upgrade-sub {
  font-size: 0.8125rem;
  color: var(--fg-muted);
  line-height: 1.4;
}
.upgrade-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--green-deep);
  color: var(--cream);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 2px;
  white-space: nowrap;
  transition: background 0.2s;
}
.upgrade-btn:hover { background: var(--green-mid); }

/* =====================
   RECOMMENDATION ENGINE
   ===================== */

/* Weekly Insight — pattern signal card */
.weekly-insight {
  margin-bottom: 1.5rem;
  padding: 1.125rem 1.375rem;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 2px;
}

.insight-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #3b82f6;
  margin-bottom: 0.75rem;
}

.insight-line {
  font-size: 0.9rem;
  color: var(--fg);
  line-height: 1.5;
  margin-bottom: 0.4rem;
}
.insight-line:last-child { margin-bottom: 0; }

.insight-metric {
  font-weight: 600;
  text-transform: capitalize;
}

/* 2-Week Improvement Flag — amber soft alert */
.improvement-flag {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: rgba(217, 119, 6, 0.06);
  border: 1px solid rgba(217, 119, 6, 0.25);
  border-radius: 2px;
}

.flag-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #d97706;
  margin-bottom: 0.75rem;
}

.flag-body {
  font-size: 0.9rem;
  color: var(--fg);
  line-height: 1.55;
  margin-bottom: 1rem;
}

.test-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.test-option {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8125rem;
}

.test-name {
  font-weight: 600;
  color: var(--fg);
  min-width: 80px;
}

.test-desc {
  color: var(--fg-muted);
  line-height: 1.4;
}

/* Conditional Supplement Recommendation — purple accent */
.supplement-rec {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 2px;
}

.supp-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7c3aed;
  margin-bottom: 0.75rem;
}

.supp-headline {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.45;
  margin-bottom: 0.625rem;
}

.supp-body {
  font-size: 0.875rem;
  color: var(--fg-muted);
  line-height: 1.55;
  margin-bottom: 0.875rem;
}

.supp-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #7c3aed;
  text-decoration: none;
  transition: opacity 0.2s;
}
.supp-link:hover { opacity: 0.7; }

/* Check-in counter */
.checkin-count {
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

/* =====================
   SUBSCRIBE PAGE
   ===================== */
.subscribe-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 2.5rem 6rem;
}
.subscribe-header { text-align: center; margin-bottom: 2.5rem; }
.subscribe-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 0.75rem;
  line-height: 1.15;
}
.subscribe-subtitle {
  font-size: 1rem;
  color: var(--fg-muted);
}
.subscribe-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
.subscribe-plan {
  background: var(--cream);
  border: 1px solid var(--border);
  padding: 2.5rem;
  position: relative;
}
.plan-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--green-deep);
  color: var(--cream);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 2px;
  margin-bottom: 1.5rem;
}
.plan-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 1rem;
}
.plan-price {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}
.price-amount {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 400;
  color: var(--fg);
  line-height: 1;
}
.price-period {
  font-size: 1rem;
  color: var(--fg-muted);
}
.plan-trial {
  font-size: 0.8125rem;
  color: var(--fg-muted);
  margin-bottom: 2rem;
}
.plan-features {
  list-style: none;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.plan-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--fg);
}
.subscribe-btn {
  width: 100%;
  padding: 0.875rem;
  background: var(--green-deep);
  color: var(--cream);
  border: none;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s;
  margin-bottom: 1rem;
}
.subscribe-btn:hover { background: var(--green-mid); }
.subscribe-note {
  font-size: 0.75rem;
  color: var(--fg-muted);
  text-align: center;
  line-height: 1.5;
}

/* Comparison table */
.subscribe-compare {
  background: var(--cream);
  border: 1px solid var(--border);
  padding: 2rem;
}
.compare-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 1.5rem;
}
.compare-table { width: 100%; }
.compare-header {
  display: grid;
  grid-template-columns: 1fr 60px 60px;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}
.compare-col {
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}
.compare-pro { color: var(--green-deep); }
.compare-row {
  display: grid;
  grid-template-columns: 1fr 60px 60px;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(26, 26, 24, 0.06);
}
.compare-feature { font-size: 0.875rem; color: var(--fg); }
.compare-val {
  text-align: center;
  color: var(--fg);
}
.compare-na {
  color: var(--fg-muted);
  text-align: center;
  font-size: 0.875rem;
}
.free-note {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}
.free-note p { font-size: 0.8125rem; color: var(--fg-muted); margin-bottom: 0.75rem; }
.free-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.free-link:hover { color: var(--fg); }

/* =====================
   PATTERN INSIGHT CARD
   ===================== */

.insight-card {
  margin-bottom: 1.5rem;
  padding: 1.5rem 1.75rem;
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 2px;
}

.insight-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #3b82f6;
  margin-bottom: 1rem;
}

.insight-main-text {
  font-size: 1rem;
  color: var(--fg);
  line-height: 1.6;
  margin-bottom: 0.75rem;
  font-weight: 400;
}

.insight-action {
  font-size: 0.875rem;
  color: var(--fg-muted);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

/* Correlation Chart */
.correlation-chart-section {
  margin-top: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(59, 130, 246, 0.15);
}

.chart-label {
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.chart-legend {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 0.625rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.legend-swatch.food { background: #3b82f6; }
.legend-swatch.bloated { background: #fca5a5; }

.correlation-chart {
  background: var(--bg);
  border: 1px solid rgba(59, 130, 246, 0.1);
  border-radius: 2px;
  padding: 0.75rem 0.5rem 0.25rem;
  margin-bottom: 0.875rem;
}

.correlation-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--fg-muted);
  flex-wrap: wrap;
}

.corr-stat { color: var(--fg-muted); }
.corr-sep { color: var(--border); }
.corr-stat.better { color: #059669; font-weight: 500; }

/* Trend fallback */
.insight-trend-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.875rem;
}

.trend-symptom {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fg);
  text-transform: capitalize;
}

.trend-badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
}

.trend-badge.improving {
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
}

.trend-badge.worsening {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.trend-badge.stable {
  background: rgba(148, 163, 184, 0.15);
  color: #64748b;
}

/* Not-enough-data state */
.insight-not-ready {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  border: 1px dashed var(--border);
  background: var(--cream);
  border-radius: 2px;
}

.not-ready-text {
  font-size: 0.875rem;
  color: var(--fg-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.progress-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.progress-label {
  font-size: 0.75rem;
  color: var(--fg-muted);
}

/* Responsive */
@media (max-width: 600px) {
  .app-container { padding: 2rem 1.5rem 4rem; }
  .symptom-row { grid-template-columns: 1fr; gap: 0.75rem; }
  .form-footer { flex-direction: column; gap: 1rem; align-items: stretch; }
  .submit-btn { width: 100%; }
  .history-grid { grid-template-columns: 1fr; }
  .checkin-form-card { padding: 1.5rem; }
  .upgrade-cta-inner { flex-direction: column; gap: 1rem; align-items: stretch; }
  .upgrade-btn { text-align: center; }
  .subscribe-container { padding: 2rem 1.5rem 4rem; }
  .subscribe-card { grid-template-columns: 1fr; }
}