/* ==========================================================================
   ER Of Fort Worth — Component Styles
   Chatbot, Forms, Blog, Service Pages, Symptoms, Insurance
   ========================================================================== */

/* ---------- AI Chatbot ---------- */
.chatbot {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 560px;
  max-height: calc(100vh - 140px);
  background: var(--color-cream);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px -15px rgba(10,31,45,.3);
  z-index: 90;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-line);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all .35s var(--ease-spring);
}
.chatbot.is-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.chatbot__header {
  background: var(--color-navy);
  color: var(--color-cream);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.chatbot__title {
  font-family: var(--font-display);
  font-size: var(--fs-20);
  font-style: italic;
  font-variation-settings: "opsz" 48, "SOFT" 60;
}
.chatbot__title small {
  display: block;
  font-family: var(--font-body);
  font-size: var(--fs-12);
  font-style: normal;
  color: rgba(255,255,255,.7);
  font-weight: 400;
  letter-spacing: 0;
  margin-top: 2px;
}
.chatbot__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.chatbot__status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  animation: pulse-dot 1.6s infinite;
}
.chatbot__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.7);
  transition: all .2s;
}
.chatbot__close:hover { background: rgba(255,255,255,.1); color: #fff; }

.chatbot__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  scroll-behavior: smooth;
}
.chatbot__body::-webkit-scrollbar { width: 6px; }
.chatbot__body::-webkit-scrollbar-track { background: transparent; }
.chatbot__body::-webkit-scrollbar-thumb { background: var(--color-line); border-radius: 3px; }

.chat-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: var(--fs-14);
  line-height: 1.5;
  animation: msgIn .35s var(--ease-out);
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-msg--bot {
  align-self: flex-start;
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-bottom-left-radius: 6px;
  color: var(--color-ink);
}
.chat-msg--bot strong { color: var(--color-emergency); }
.chat-msg--user {
  align-self: flex-end;
  background: var(--color-navy);
  color: var(--color-cream);
  border-bottom-right-radius: 6px;
}

.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 var(--space-2);
}
.chat-quick-replies button {
  padding: 8px 14px;
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--color-navy);
  font-weight: 500;
  transition: all .2s;
}
.chat-quick-replies button:hover {
  background: var(--color-navy);
  color: var(--color-cream);
  border-color: var(--color-navy);
}

.chat-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 14px 18px;
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: 18px;
  border-bottom-left-radius: 6px;
}
.chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-muted);
  animation: typing 1.3s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.chatbot__footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-line);
  background: var(--color-cream);
}
.chatbot__input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  padding: 6px 6px 6px 18px;
}
.chatbot__input-wrap:focus-within { border-color: var(--color-navy); }
.chatbot__input {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--fs-14);
  outline: none;
  color: var(--color-ink);
}
.chatbot__send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-navy);
  color: var(--color-cream);
  display: grid;
  place-items: center;
  transition: all .2s;
}
.chatbot__send:hover { background: var(--color-navy-700); transform: scale(1.05); }
.chatbot__send svg { width: 16px; height: 16px; }

.chatbot__emergency-note {
  font-size: 11px;
  text-align: center;
  color: var(--color-muted);
  padding: 8px var(--space-4);
  background: var(--color-emergency-100);
  color: var(--color-emergency-700);
  font-weight: 500;
}
.chatbot__emergency-note a { color: inherit; text-decoration: underline; font-weight: 700; }

/* ---------- Symptoms grid ---------- */
.symptoms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}
@media (max-width: 640px) { .symptoms-grid { grid-template-columns: 1fr; } }
.symptom-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  transition: all .3s var(--ease-out);
}
.symptom-item:hover {
  border-color: var(--color-emergency);
  background: var(--color-emergency-100);
  transform: translateX(4px);
}
.symptom-item__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-emergency);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.symptom-item__icon svg { width: 16px; height: 16px; }
.symptom-item__text {
  font-size: var(--fs-14);
  line-height: 1.5;
}
.symptom-item__text strong {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 2px;
  font-size: var(--fs-16);
}

/* ---------- Treatment cards ---------- */
.treatment-card {
  background: var(--color-cream-200);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  border: 1px solid var(--color-line);
}
.treatment-card h5 {
  font-size: var(--fs-24);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
}
.treatment-card h5 .num {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--color-emergency);
  font-size: 0.9em;
}
.treatment-card p { margin: 0; color: var(--color-muted); font-size: var(--fs-14); }

/* ---------- "Why choose us" feature card ---------- */
.feature-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5) 0;
}
.feature-card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--color-cream-200);
  color: var(--color-navy);
  display: grid;
  place-items: center;
  margin-bottom: var(--space-3);
}
.feature-card__icon svg { width: 28px; height: 28px; }
.feature-card h5 { font-size: var(--fs-24); margin-bottom: 6px; }
.feature-card p { font-size: var(--fs-14); color: var(--color-muted); margin: 0; }

/* ---------- Insurance badges ---------- */
.insurance-strip {
  background: var(--color-cream-200);
  padding: var(--space-7) 0;
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
}
.insurance-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-5);
  align-items: center;
  margin-top: var(--space-5);
}
@media (max-width: 800px) { .insurance-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .insurance-grid { grid-template-columns: repeat(2, 1fr); } }
.insurance-logo {
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--fs-20);
  color: var(--color-navy);
  padding: var(--space-3);
  background: var(--color-white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-line);
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 24;
  font-weight: 500;
  transition: all .3s;
}
.insurance-logo:hover {
  background: var(--color-navy);
  color: var(--color-cream);
  transform: translateY(-2px);
}

/* ---------- Contact / Forms ---------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--space-4);
}
.form-group label {
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--color-ink);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--color-line);
  background: var(--color-white);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--fs-16);
  color: var(--color-ink);
  transition: all .25s var(--ease-out);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-navy);
  box-shadow: 0 0 0 4px var(--color-navy-50);
}
.form-group textarea { resize: vertical; min-height: 120px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
}
@media (max-width: 980px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-info { display: flex; flex-direction: column; gap: var(--space-5); }
.contact-card {
  padding: var(--space-5);
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  display: flex;
  gap: var(--space-4);
}
.contact-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--color-navy);
  color: var(--color-cream);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.contact-card__icon svg { width: 22px; height: 22px; }
.contact-card h5 { font-size: var(--fs-20); margin-bottom: 4px; }
.contact-card p { margin: 0; font-size: var(--fs-14); color: var(--color-muted); line-height: 1.6; }
.contact-card a { color: var(--color-emergency); font-weight: 600; }

/* ---------- Map embed ---------- */
.map-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-line);
  aspect-ratio: 16/10;
}
.map-container iframe { width: 100%; height: 100%; border: 0; }

/* ---------- Blog ---------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
@media (max-width: 980px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .blog-grid { grid-template-columns: 1fr; } }

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all .35s var(--ease-out);
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.blog-card__image {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--color-navy-100);
}
.blog-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease-out);
}
.blog-card:hover .blog-card__image img { transform: scale(1.05); }

.blog-card__body { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); flex: 1; }
.blog-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-12);
  color: var(--color-muted);
  letter-spacing: 0.04em;
}
.blog-card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--color-muted); }
.blog-card h4 { font-size: var(--fs-24); margin: 0; line-height: 1.2; }
.blog-card p { font-size: var(--fs-14); color: var(--color-muted); margin: 0; }
.blog-card__link {
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--color-navy);
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.blog-card:hover .blog-card__link { gap: 12px; }
.blog-card__link::after { content: "→"; transition: margin .3s; }

/* ---------- Blog article ---------- */
.article {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--space-7) 0;
}
.article__meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  font-size: var(--fs-14);
  color: var(--color-muted);
}
.article__hero {
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--space-6) 0 var(--space-7);
}
.article__hero img { width: 100%; height: 100%; object-fit: cover; }

.article-body { font-size: var(--fs-18); line-height: 1.75; color: var(--color-ink); }
.article-body p { margin-bottom: var(--space-5); max-width: 100%; }
.article-body h2 { font-size: var(--fs-44); margin: var(--space-7) 0 var(--space-4); }
.article-body h3 { font-size: var(--fs-32); margin: var(--space-6) 0 var(--space-4); }
.article-body ul, .article-body ol { margin: 0 0 var(--space-5) var(--space-5); }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: var(--space-2); }
.article-body blockquote {
  border-left: 4px solid var(--color-emergency);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-6) 0;
  background: var(--color-cream-200);
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--fs-24);
  color: var(--color-ink);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.article-body a { color: var(--color-navy); text-decoration: underline; text-underline-offset: 4px; }
.article-body a:hover { color: var(--color-emergency); }

/* ---------- Service icons grid (homepage condition list) ---------- */
.conditions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}
@media (max-width: 900px) { .conditions-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .conditions-grid { grid-template-columns: 1fr; } }

.condition-chip {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 16px 18px;
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  font-size: var(--fs-14);
  font-weight: 500;
  color: var(--color-ink);
  transition: all .3s var(--ease-out);
}
.condition-chip:hover {
  border-color: var(--color-navy);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}
.condition-chip__icon {
  width: 36px;
  height: 36px;
  background: var(--color-navy-50);
  color: var(--color-navy);
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.condition-chip__icon svg { width: 18px; height: 18px; }

/* ---------- Sticky table of contents (service pages) ---------- */
.service-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--space-8);
  padding: var(--space-7) 0;
}
@media (max-width: 980px) { .service-layout { grid-template-columns: 1fr; } }

.toc {
  position: sticky;
  top: calc(var(--nav-height) + 20px);
  align-self: start;
  font-size: var(--fs-14);
}
@media (max-width: 980px) { .toc { display: none; } }
.toc h6 {
  font-family: var(--font-body);
  font-size: var(--fs-12);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--space-3);
  font-weight: 600;
}
.toc ul { display: flex; flex-direction: column; gap: 2px; }
.toc a {
  display: block;
  padding: 10px 14px;
  border-left: 2px solid var(--color-line);
  color: var(--color-muted);
  font-size: var(--fs-14);
  transition: all .2s var(--ease-out);
}
.toc a:hover, .toc a.is-active {
  color: var(--color-navy);
  border-left-color: var(--color-emergency);
  background: var(--color-cream-200);
}

/* ---------- Article CTA box ---------- */
.cta-inline {
  background: linear-gradient(135deg, var(--color-navy), var(--color-navy-700));
  color: var(--color-cream);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  margin: var(--space-6) 0;
  display: flex;
  gap: var(--space-5);
  align-items: center;
  flex-wrap: wrap;
}
.cta-inline > div { flex: 1; min-width: 240px; }
.cta-inline h5 { color: var(--color-cream); margin-bottom: 4px; }
.cta-inline p { color: rgba(255,255,255,.75); margin: 0; font-size: var(--fs-14); }
.cta-inline .btn--emergency { flex-shrink: 0; }

/* ---------- Stat row ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin: var(--space-6) 0;
}
@media (max-width: 760px) { .stat-row { grid-template-columns: 1fr; } }
.stat-item { text-align: center; }
.stat-item__num {
  font-family: var(--font-display);
  font-size: var(--fs-60);
  color: var(--color-emergency);
  line-height: 1;
  font-variation-settings: "opsz" 96, "SOFT" 50;
  font-style: italic;
}
.stat-item__label { font-size: var(--fs-14); color: var(--color-muted); margin-top: 8px; }

/* ---------- Online check-in / form panels ---------- */
.checkin-card {
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  box-shadow: var(--shadow-sm);
}

/* ---------- Locations big detail ---------- */
.location-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-7);
  align-items: center;
  padding: var(--space-8) 0;
}
@media (max-width: 980px) { .location-hero { grid-template-columns: 1fr; } }

/* ---------- Pill row (related links) ---------- */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.pill-row a {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--color-white);
  border: 1px solid var(--color-line);
  font-size: var(--fs-14);
  font-weight: 500;
  color: var(--color-ink);
  transition: all .25s;
}
.pill-row a:hover {
  background: var(--color-navy);
  color: var(--color-cream);
  border-color: var(--color-navy);
}

/* ---------- Subtle texture overlay ---------- */
.texture-grain::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: .04;
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* ---------- Wait-time ticker / hours ---------- */
.hours-bar {
  background: var(--color-mint-100);
  color: var(--color-mint);
  padding: 14px 0;
  text-align: center;
  font-size: var(--fs-14);
  font-weight: 600;
}
.hours-bar strong { font-family: var(--font-display); font-size: var(--fs-18); margin: 0 8px; font-style: italic; }

/* Print styles */
@media print {
  .nav, .footer, .floating-cta, .chatbot, .emergency-bar, .chatbot-toggle { display: none !important; }
  body { background: white; color: black; }
}
