/* ============================================================================
 * The Fatherhood Collective — joshuaaah.com color bible re-theme (2026-11-03)
 * White-dominant base, deep purple brand/structural header, teal for the
 * dad's own chat bubble + send button (interactive/active per the bible).
 * Same tokens, radius scale and typography as the joshuaaah.com hub
 * (X:\WebSites\www.joshuaaah.com\styles.css).
 *
 * SAFETY-CRITICAL: the crisis-resource line in the footer (911 / Childhelp /
 * 988) is deliberately NOT themed into brand purple/teal. It keeps its own
 * high-contrast alert treatment (warm red-tinted banner, bold text) so it
 * reads as important/different, not as standard chrome — do not soften this
 * on a future pass without re-checking contrast.
 * ========================================================================== */
:root {
  --jx-bg:             #FFFFFF;
  --jx-surface:        #F7F6FA;
  --jx-surface-alt:    #ECEAF1;
  --jx-primary:        #3B1F6B;
  --jx-primary-hover:  #5A3394;
  --jx-accent:         #0D9488;
  --jx-accent-hover:   #14B8A6;
  --jx-accent-text:    #0F766E;
  --jx-text:           #121117;
  --jx-text-secondary: #6B6974;
  --jx-border:         #D8D5E0;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;

  --font-sans: 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;

  /* legacy names used throughout this file */
  --cream: var(--jx-bg);
  --paper: var(--jx-surface);
  --ink: var(--jx-text);
  --ink-soft: var(--jx-text-secondary);
  --line: var(--jx-border);
  --coach-bg: var(--jx-surface-alt);
  /* User bubble fill uses the darkened teal (not raw --jx-accent): it's a
     large solid fill carrying white text, and raw #0D9488 + white only
     clears ~3.75:1 (below the 4.5:1 AA floor for normal text). #0F766E
     clears ~5.5:1. See feedback_joshuaaah_color_bible.md. */
  --user-bg: var(--jx-accent-text);
  --user-text: #FFFFFF;

  /* Crisis-resource banner — intentionally its own warm "alert" palette,
     distinct from both brand purple/teal AND from the plain --jx-warning
     amber used for generic warnings elsewhere, so it never reads as just
     another themed card. */
  --crisis-bg: #FEF2F2;
  --crisis-border: #DC2626;
  --crisis-text: #7F1D1D;
  --crisis-link: #B91C1C;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  height: 100%;
}

body {
  background-image:
    radial-gradient(circle at 15% 8%, rgba(13, 148, 136, 0.06), transparent 40%),
    radial-gradient(circle at 85% 92%, rgba(59, 31, 107, 0.05), transparent 40%);
}

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; }

.page {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 18px;
}

/* Header bar — deep purple + white, sticky like the hub nav, so this app
   is recognizably part of the same family even though it's a full-height
   chat layout rather than a scrolling marketing page. */
.hero {
  text-align: center;
  padding: 18px 16px;
  margin: 0 -18px;
  background: var(--jx-primary);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.hero__mark {
  color: #ffffff;
  display: inline-flex;
  margin-bottom: 4px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0 0 4px;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.hero__tagline {
  margin: 0;
  color: rgba(255,255,255,0.82);
  font-style: italic;
  font-family: 'Lora', Georgia, serif;
  font-size: 0.92rem;
}

.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 2px 20px;
  overflow-y: auto;
}

.msg {
  display: flex;
  max-width: 88%;
}

.msg--coach { align-self: flex-start; }
.msg--user { align-self: flex-end; }

.msg__bubble {
  padding: 13px 16px;
  border-radius: var(--radius-lg);
  line-height: 1.52;
  font-size: 1rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.msg--coach .msg__bubble {
  background: var(--coach-bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-top-left-radius: var(--radius-sm);
}

.msg--user .msg__bubble {
  background: var(--user-bg);
  color: var(--user-text);
  border-top-right-radius: var(--radius-sm);
}

.msg__bubble p { margin: 0 0 0.6em; }
.msg__bubble p:last-child { margin-bottom: 0; }

.msg__bubble .msg__heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--jx-primary);
  margin: 0.9em 0 0.35em;
}
.msg__bubble .msg__heading:first-child { margin-top: 0; }

.msg__bubble .msg__list {
  margin: 0 0 0.6em;
  padding-left: 1.15em;
}
.msg__bubble .msg__list:last-child { margin-bottom: 0; }
.msg__bubble .msg__list li { margin: 0 0 0.35em; }
.msg__bubble .msg__list li:last-child { margin-bottom: 0; }

/* Reserved for any future dynamically-inserted safety message bubble —
   kept visually aligned with the static crisis banner below (same warm
   alert palette), not with the brand purple/teal used elsewhere. */
.msg--safety .msg__bubble {
  background: var(--crisis-bg);
  border: 1px solid var(--crisis-border);
  color: var(--crisis-text);
}

.msg__bubble.is-typing {
  color: var(--ink-soft);
  font-style: italic;
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-soft);
  margin: 0 2px;
  animation: pulse 1.1s infinite ease-in-out;
}
.dot:nth-child(2) { animation-delay: 0.15s; }
.dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes pulse { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.composer {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: linear-gradient(165deg, var(--jx-surface-alt), #ffffff);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(59,31,107,0.08);
  padding: 10px 10px 10px 16px;
  margin-bottom: 10px;
}

.composer textarea {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  resize: none;
  max-height: 160px;
  padding: 6px 0;
  outline: none;
}

.composer textarea::placeholder { color: var(--ink-soft); opacity: 0.85; }

/* Send button — teal (interactive/CTA per the bible). This carries a
   white icon via currentColor, not text, so the 3:1 non-text contrast
   floor applies (not the 4.5:1 text floor) — raw teal clears that easily. */
.composer button {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--jx-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.composer button:hover { background: var(--jx-accent-hover); }
.composer button:active { transform: scale(0.95); }
.composer button:disabled { opacity: 0.45; cursor: default; }

.footer {
  padding: 4px 2px 28px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.5;
  text-align: center;
}

.footer p { margin: 0 0 10px; }

/* Crisis-resource banner — always visible, intentionally NOT brand-colored.
   High-contrast warm alert treatment: bold dark-red text on a soft red
   tint with a solid red border, so it reads as "important/different" at
   a glance rather than blending into the rest of the chrome. */
.footer__crisis {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  background: var(--crisis-bg);
  border: 1px solid var(--crisis-border);
  border-left: 4px solid var(--crisis-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--crisis-text);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.45;
}
.footer__crisis-icon { font-size: 1.1rem; line-height: 1; flex-shrink: 0; margin-top: 1px; }
.footer__crisis strong { color: var(--crisis-text); font-weight: 800; }
.footer__crisis a { color: var(--crisis-link); font-weight: 700; text-decoration: underline; }

.footer__muted { font-size: 0.78rem; opacity: 0.85; }

.footer__reset {
  margin-left: 6px;
  background: none;
  border: none;
  color: var(--ink-soft);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0;
  font-family: inherit;
}
.footer__reset:hover { color: var(--jx-accent-text); }

@media (max-width: 480px) {
  .hero { padding: 14px 16px; }
  .hero h1 { font-size: 1.3rem; }
  .msg { max-width: 94%; }
  .footer__crisis { font-size: 0.82rem; }
}
