/* Curate Mental Health — prototype styles
   Visual identity mirrors curatementalhealth.com (Erik's practice site)
   Palette: warm cream + teal + earth tones */

@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900&display=swap');

:root {
  /* Brand palette — sourced directly from curatementalhealth.com Wix theme tokens */
  --cream: #FBFBF3;
  --sand: #F2EDDB;
  --khaki: #D6CDAC;
  --olive: #777355;
  --teal: #3D768A;
  --teal-dark: #2D5868;
  --teal-light: #6B9BAE;
  --pale-blue: #EAF2F6;
  --forest: #09371F;
  --ink: #2B2716;
  --ink-soft: #6B6655;

  /* Functional colors (not in Erik's palette but needed for clinical UI) */
  --alert: #B95141;
  --alert-bg: #FBEDEA;
  --success: #4F7A4E;
  --success-bg: #ECF1EA;

  /* Typography */
  --font-sans: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing & radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;

  /* Shadows */
  --shadow-card: 0 1px 3px rgba(43, 39, 22, 0.04), 0 4px 12px rgba(43, 39, 22, 0.04);
  --shadow-lg: 0 8px 32px rgba(43, 39, 22, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.5em 0;
  line-height: 1.15;
}

h1 { font-size: 3rem; font-weight: 900; }
h2 { font-size: 2rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.05rem; font-weight: 700; }

p { margin: 0 0 1em 0; }

a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 600;
}
a:hover { color: var(--teal-dark); text-decoration: underline; }

.muted { color: var(--ink-soft); }
.tiny { font-size: 0.8rem; }
.small { font-size: 0.9rem; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }

/* ====== TOP NAVIGATION ====== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 251, 243, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(214, 205, 172, 0.4);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--teal);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.brand-mark {
  width: 28px; height: 28px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.95rem;
}
.nav-links a {
  color: var(--ink);
  font-weight: 500;
}
.nav-links a.active {
  color: var(--teal);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.role-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 100px;
  background: var(--pale-blue);
  color: var(--teal-dark);
}
.role-badge.provider { background: var(--sand); color: var(--olive); }
.demo-switch {
  font-size: 0.8rem;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--khaki);
  padding: 6px 12px;
  border-radius: 100px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
}
.demo-switch:hover { background: var(--sand); color: var(--ink); text-decoration: none; }

/* ====== LAYOUT ====== */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px 96px;
}
.page-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 32px 96px;
}
.page-header {
  margin-bottom: 32px;
}
.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 12px;
}

/* ====== BUTTONS ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--r-md);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--teal);
  color: var(--cream);
}
.btn-primary:hover {
  background: var(--teal-dark);
  color: var(--cream);
  text-decoration: none;
}
.btn-secondary {
  background: transparent;
  color: var(--teal);
  border: 1.5px solid var(--teal);
}
.btn-secondary:hover {
  background: var(--pale-blue);
  text-decoration: none;
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--khaki);
}
.btn-ghost:hover { background: var(--sand); color: var(--ink); text-decoration: none; }
.btn-lg {
  padding: 16px 32px;
  font-size: 1rem;
}
.btn-block { width: 100%; }

/* ====== CARDS ====== */
.card {
  background: white;
  border: 1px solid rgba(214, 205, 172, 0.5);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
}
.card-tight { padding: 20px; }
.card-accent {
  background: var(--pale-blue);
  border-color: rgba(61, 118, 138, 0.15);
}
.card-sand {
  background: var(--sand);
  border-color: rgba(214, 205, 172, 0.6);
}
.card-alert {
  background: var(--alert-bg);
  border-color: rgba(185, 81, 65, 0.25);
}
.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-h h3 { margin-bottom: 0; }

/* ====== GRID ====== */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-sidebar { grid-template-columns: 340px 1fr; gap: 24px; }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-sidebar { grid-template-columns: 1fr; }
}

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

/* ====== FORMS ====== */
.field {
  margin-bottom: 20px;
}
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 0.95rem;
}
.field .hint {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
input[type="text"],
input[type="email"],
input[type="number"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--khaki);
  border-radius: var(--r-md);
  background: white;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  font-weight: 400;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(61, 118, 138, 0.15);
}
textarea { resize: vertical; min-height: 90px; }

/* Likert-style radio group for PHQ-9 / GAD-7 */
.likert-row {
  background: white;
  border: 1px solid rgba(214, 205, 172, 0.5);
  border-radius: var(--r-md);
  padding: 18px 20px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}
.likert-question {
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}
.likert-question .qn {
  display: inline-block;
  width: 28px;
  font-weight: 800;
  color: var(--teal);
}
.likert-options {
  display: flex;
  gap: 6px;
}
.likert-options label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border: 1.5px solid var(--khaki);
  border-radius: var(--r-md);
  cursor: pointer;
  background: var(--cream);
  font-size: 0.75rem;
  color: var(--ink-soft);
  font-weight: 600;
  min-width: 64px;
  transition: all 0.12s ease;
}
.likert-options label:hover {
  border-color: var(--teal-light);
  background: var(--pale-blue);
}
.likert-options input[type="radio"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--khaki);
  border-radius: 50%;
  cursor: pointer;
  margin: 0;
}
.likert-options input[type="radio"]:checked {
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: inset 0 0 0 3px white;
}
.likert-options label:has(input:checked) {
  background: var(--pale-blue);
  border-color: var(--teal);
  color: var(--teal-dark);
}
@media (max-width: 720px) {
  .likert-row { grid-template-columns: 1fr; }
}

/* ====== STATS / METRICS ====== */
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 700;
}
.stat-trend.improving { color: var(--success); }
.stat-trend.worsening { color: var(--alert); }
.stat-trend.stable { color: var(--ink-soft); }

/* PHQ-9 severity bands */
.severity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.severity.minimal { background: var(--success-bg); color: var(--success); }
.severity.mild { background: var(--sand); color: var(--olive); }
.severity.moderate { background: #FBF1DA; color: #886632; }
.severity.moderately-severe { background: var(--alert-bg); color: var(--alert); }
.severity.severe { background: #F2D9D3; color: #8E2D20; }

/* ====== TABLE ====== */
.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid rgba(214, 205, 172, 0.5);
}
.table th {
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 14px 20px;
  background: var(--cream);
  border-bottom: 1px solid var(--khaki);
}
.table td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(214, 205, 172, 0.3);
  font-size: 0.95rem;
}
.table tr:last-child td { border-bottom: none; }
.table tr.clickable { cursor: pointer; transition: background 0.12s; }
.table tr.clickable:hover { background: var(--pale-blue); }
.table tr.alert-row td:first-child { border-left: 3px solid var(--alert); padding-left: 17px; }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--pale-blue);
  color: var(--teal-dark);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }

/* ====== PROGRESS BAR ====== */
.progress {
  width: 100%;
  height: 8px;
  background: var(--sand);
  border-radius: 100px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 100px;
}

/* ====== CHART CONTAINER ====== */
.chart-card {
  background: white;
  border: 1px solid rgba(214, 205, 172, 0.5);
  border-radius: var(--r-lg);
  padding: 24px;
}
.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ====== MODULE / WORKSHEET CARDS ====== */
.module-card {
  background: white;
  border: 1px solid rgba(214, 205, 172, 0.5);
  border-radius: var(--r-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.15s ease;
  cursor: pointer;
  position: relative;
}
.module-card:hover {
  border-color: var(--teal-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.module-card.locked {
  opacity: 0.55;
  cursor: not-allowed;
}
.module-card.locked:hover { transform: none; box-shadow: none; }
.module-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--sand);
  color: var(--olive);
  align-self: flex-start;
}
.module-tag.active { background: var(--pale-blue); color: var(--teal-dark); }
.module-tag.complete { background: var(--success-bg); color: var(--success); }

/* ====== ALERTS / BANNERS ====== */
.banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  border-radius: var(--r-lg);
  margin-bottom: 24px;
  font-size: 0.95rem;
}
.banner.info { background: var(--pale-blue); color: var(--teal-dark); }
.banner.warn { background: var(--alert-bg); color: var(--alert); }
.banner-icon { font-size: 1.4rem; }

/* ====== HERO (landing) ====== */
.hero {
  text-align: center;
  padding: 96px 32px 64px;
  max-width: 720px;
  margin: 0 auto;
}
.hero h1 {
  font-size: 3.5rem;
  font-weight: 900;
  margin-bottom: 24px;
}
.hero .tagline {
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--ink-soft);
  margin-bottom: 40px;
  line-height: 1.4;
}

.role-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 880px;
  margin: 0 auto 64px;
  padding: 0 32px;
}
.role-card {
  background: white;
  border: 1px solid rgba(214, 205, 172, 0.6);
  border-radius: var(--r-xl);
  padding: 40px 32px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.role-card:hover {
  border-color: var(--teal);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.role-card .icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pale-blue);
  color: var(--teal);
  border-radius: 50%;
}
.role-card.provider .icon { background: var(--sand); color: var(--olive); }
.role-card h3 { margin-bottom: 0; font-size: 1.5rem; }
.role-card p { margin-bottom: 0; color: var(--ink-soft); }

@media (max-width: 720px) {
  .role-cards { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.2rem; }
  .hero .tagline { font-size: 1.1rem; }
}

/* ====== TIMELINE / WORKSHEET HISTORY ====== */
.timeline-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(214, 205, 172, 0.3);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-date {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-weight: 600;
}

/* ====== DEMO ANNOTATION ====== */
.demo-note {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: var(--cream);
  padding: 10px 16px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.6;
  z-index: 100;
  pointer-events: none;
}

/* utility margins */
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mt-12 { margin-top: 48px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
