/*
  Peaceful Behavioral Services — shared design system
  ---------------------------------------------------
  Calming blue & white, soft teal + navy accents. Senior-friendly:
  large readable type, high contrast, generous touch targets (>=48px),
  clear focus states. Vanilla — audience may be on older devices.
  Used by both the home page and the Refer a Client page.
*/

:root {
  /* Cobalt Blue & Deep Navy from Logo */
  --navy:        #091630;   /* Deepest navy, for headings */
  --navy-deep:   #050e1f;   /* Deeper dark navy, for footer / crisis header */
  --blue:        #0046ad;   /* Cobalt Blue matching logo primary */
  --blue-deep:   #00317a;   /* Deep Cobalt Blue for hover states */
  --blue-bright: #296beb;   /* Bright Cobalt Blue for active outlines */
  
  /* Gold accents from Logo */
  --gold:        #e2a510;   /* Gold matching logo accent */
  --gold-deep:   #b58105;   /* Hover gold */
  --gold-soft:   #fdf8e7;   /* Light cream gold tint bg */
  --gold-bright: #f2b311;   /* Bright gold for dark bg elements */
  
  /* Backwards compatibility for --teal and --teal-deep */
  --teal:        var(--gold);
  --teal-deep:   var(--gold-deep);

  /* White & Sky backgrounds */
  --sky:         #f0f4ff;   /* Tinted section bg (soft royal blue tint) */
  --sky-2:       #f8fafc;   /* Very light tint section bg */
  --gray:        #ffffff;   /* Main page background (now White) */
  --line:        #e2e8f0;   /* Light borders */
  --line-soft:   #f1f5f9;   /* Very soft lines */

  /* Dark navy body typography */
  --ink:         #111e30;   /* Dark navy body text */
  --ink-soft:    #475569;   /* Slate/navy secondary text */
  --white:       #ffffff;

  --r-card: 18px;
  --r-pill: 999px;
  --r-input: 12px;

  --f-head: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --max: 1200px;
  --shadow-sm: 0 2px 10px -4px rgba(12, 30, 54, 0.15);
  --shadow-md: 0 16px 40px -22px rgba(12, 30, 54, 0.3);
  --shadow-lg: 0 28px 60px -30px rgba(12, 30, 54, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--f-body);
  color: var(--ink);
  background: var(--gray);
  font-size: 18px;            /* senior-friendly base */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--blue-deep); }
button { font: inherit; cursor: pointer; }

::selection { background: rgba(0, 70, 173, 0.18); }

/* Visible focus for keyboard users */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, .chip:focus-visible {
  outline: 3px solid var(--blue-bright);
  outline-offset: 2px;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--f-head);
  color: var(--navy);
  font-weight: 600;
  letter-spacing: -0.018em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(36px, 6.2vw, 60px); line-height: 1.06; }
h2 { font-size: clamp(28px, 4.2vw, 42px); line-height: 1.12; }
h3 { font-size: clamp(20px, 2.4vw, 25px); line-height: 1.25; }
.accent { color: var(--teal); }
.eyebrow {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
}

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 22px;
  position: relative;
}
@media (min-width: 760px) { .wrap { padding: 0 36px; } }
section { position: relative; }
.section-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 44px;
  max-width: 720px;
}
.section-head p { margin: 0; font-size: 18.5px; color: var(--ink-soft); max-width: 58ch; text-wrap: pretty; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; align-items: center; }

/* ---------- Skip link ---------- */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--navy); color: #fff; padding: 12px 18px;
  border-radius: 0 0 10px 0; font-weight: 600; text-decoration: none;
}
.skip:focus { left: 0; }

/* ---------- Crisis bar ---------- */
.crisis {
  background: var(--navy-deep);
  color: #e8f0f9;
  font-size: 15px;
  position: relative;
  z-index: 60;
}
.crisis-inner {
  display: flex; align-items: center; justify-content: center;
  gap: 11px; padding: 10px 18px; text-align: center; flex-wrap: wrap; line-height: 1.35;
}
.crisis-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold-bright); display: inline-block; flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(242, 179, 17, 0.6);
  animation: pulse 2.4s ease-out infinite;
}
@media (prefers-reduced-motion: reduce) { .crisis-dot { animation: none; } }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(242, 179, 17, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(242, 179, 17, 0); }
  100% { box-shadow: 0 0 0 0 rgba(242, 179, 17, 0); }
}
.crisis a { color: var(--gold-bright); text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 240ms ease, box-shadow 240ms ease;
}
.nav.is-stuck { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 13px 0;
}
.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); }
.logo-mark {
  width: 40px; height: 40px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.logo-name { font-family: var(--f-head); font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.logo-tag { font-size: 12px; color: var(--ink-soft); font-weight: 600; letter-spacing: 0.02em; }

.nav-links { display: none; gap: 4px; list-style: none; margin: 0; padding: 0; align-items: center; }
.nav-links a {
  text-decoration: none; color: var(--ink); font-size: 16px; font-weight: 600;
  padding: 9px 14px; border-radius: 9px; transition: background 160ms ease, color 160ms ease;
}
.nav-links a:hover { background: var(--sky); color: var(--blue-deep); }
.nav-links a.active { color: var(--blue-deep); background: var(--sky); }
@media (min-width: 1000px) { .nav-links { display: flex; } }
.nav-right { display: flex; align-items: center; gap: 10px; }

/* Mobile menu */
.menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 11px;
  background: var(--sky); border: 1px solid var(--line); color: var(--navy);
}
@media (min-width: 1000px) { .menu-btn { display: none; } }
.mobile-menu {
  display: none;
  position: fixed; inset: 0; z-index: 70;
  background: rgba(14, 45, 75, 0.45);
}
.mobile-menu.is-open { display: block; }
.mobile-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(86vw, 360px);
  background: #fff; padding: 22px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: -20px 0 50px -20px rgba(14, 45, 75, 0.5);
  transform: translateX(100%); transition: transform 260ms ease;
}
.mobile-menu.is-open .mobile-panel { transform: translateX(0); }
.mobile-panel .mm-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.mobile-panel a {
  text-decoration: none; color: var(--navy); font-family: var(--f-head); font-weight: 600;
  font-size: 19px; padding: 14px 12px; border-radius: 11px;
}
.mobile-panel a:hover { background: var(--sky); }
.mobile-panel .mm-cta { margin-top: 14px; }
.close-btn { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--navy); display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 24px; border-radius: var(--r-pill);
  font-family: var(--f-body); font-weight: 700; font-size: 16.5px; letter-spacing: 0.005em;
  text-decoration: none; border: 2px solid transparent;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  white-space: nowrap; min-height: 50px;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); box-shadow: 0 10px 26px -12px rgba(0, 70, 173, 0.4); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-deep); box-shadow: 0 10px 26px -12px rgba(226, 165, 16, 0.4); }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue-deep); background: var(--sky-2); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: #fff; }
.btn-white { background: #fff; color: var(--navy); }
.btn-white:hover { background: var(--sky); color: var(--blue-deep); }
.btn-sm { padding: 10px 18px; font-size: 15px; min-height: 44px; }
.btn-lg { padding: 17px 30px; font-size: 18px; min-height: 56px; }
.btn svg { flex-shrink: 0; }

/* ---------- Badges / chips ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 10px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 15px; border-radius: var(--r-pill);
  background: #fff; border: 1px solid var(--line);
  font-size: 14.5px; font-weight: 600; color: var(--navy);
  box-shadow: var(--shadow-sm);
}
.badge svg { color: var(--teal); }
.badge.on-blue { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.28); color: #fff; box-shadow: none; }
.badge.on-blue svg { color: var(--gold-bright); }

/* Location badge pill */
.loc-badge {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 16px; border-radius: var(--r-pill);
  background: var(--sky); color: var(--blue-deep);
  font-size: 14.5px; font-weight: 700; letter-spacing: 0.01em;
}
.loc-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }

/* ---------- Footer ---------- */
.footer { background: var(--navy-deep); color: #cfe0f0; padding: 56px 0 30px; }
.footer a { color: #cfe0f0; text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 36px; margin-bottom: 40px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; } }
.footer h4 { color: #fff; font-size: 15px; letter-spacing: 0.04em; margin-bottom: 16px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; font-size: 16px; }
.footer-brand .logo-name { color: #fff; }
.footer-brand .logo-tag { color: #9fc0dd; }
.footer p.fdesc { color: #aecae3; font-size: 16px; max-width: 38ch; margin: 16px 0 0; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.14); padding-top: 22px;
  display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between;
  font-size: 14px; color: #9fc0dd;
}
.footer-disclaimer { max-width: 70ch; line-height: 1.5; }

/* ---------- Floating mobile call ---------- */
.fab-call {
  position: fixed; bottom: 16px; left: 16px; right: 16px; z-index: 45;
  display: none; background: var(--teal); color: #fff; text-decoration: none;
  padding: 16px 22px; border-radius: var(--r-pill); font-weight: 700; font-size: 17px;
  align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 16px 36px -12px rgba(14, 45, 75, 0.55);
  transform: translateY(140%); transition: transform 260ms ease;
}
.fab-call.is-on { transform: translateY(0); }
@media (max-width: 999px) { .fab-call { display: inline-flex; } }

/* ---------- Forms (shared) ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 15px; font-weight: 700; color: var(--navy); }
.field .req { color: var(--blue); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 17px; padding: 13px 15px;
  border-radius: var(--r-input); border: 1.5px solid var(--line);
  background: #fff; color: var(--ink); min-height: 50px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
  -webkit-appearance: none; appearance: none; width: 100%;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%23091630' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 15px center; padding-right: 40px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 70, 173, 0.16);
}
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #c0392b; }
.field-error { color: #c0392b; font-size: 14px; font-weight: 600; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .form-row.two { grid-template-columns: 1fr 1fr; } }

.form-success { display: none; }
.form-success.is-on { display: block; }
.succ-mark {
  width: 60px; height: 60px; border-radius: 50%; background: var(--teal); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px;
}

.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; }

/* Anchor offset for sticky nav */
[id] { scroll-margin-top: 96px; }
