/* Cascade layers: declare Tailwind's layer order up front and register this file's
   classes in the "components" layer, so Tailwind utilities (layer "utilities") can
   override them per element - e.g. "card p-0" or "card bg-amber-50". Left unlayered,
   these rules would beat every utility regardless of stylesheet order, because
   unlayered CSS always wins over layered CSS. Order matters: components stays above
   base so these classes still beat Tailwind's preflight resets. */
@layer theme, base, components, utilities;

@layer components {

/* heallium - main stylesheet */

/* ── Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Roboto', sans-serif;
  color: #111827;
  background-color: #f4f6f9;
  /* Long unbroken strings (URLs, tokens, emails) wrap instead of overflowing
     their container. overflow-wrap is inherited, so this applies site-wide;
     break-word only breaks a word when it would otherwise overflow, leaving
     normal wrapping untouched. Override locally only with a good reason. */
  overflow-wrap: break-word;
}

/* ── Interactive cursors ───────────────────────── */
/* Tailwind's preflight does not add a pointer cursor to buttons, so set one
   here for everything clickable to keep affordances consistent site-wide. */
button:not(:disabled),
summary,
select,
[role="button"],
[role="tab"],
[onclick] {
  cursor: pointer;
}
button:disabled,
[aria-disabled="true"],
.disabled {
  cursor: not-allowed;
}

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.btn:focus-visible { outline: 2px solid #017e72; outline-offset: 2px; }

.btn-primary {
  background-color: #09263a;
  color: #fff;
}
.btn-primary:hover { background-color: #0f3550; }

.btn-blue {
  background-color: #017e72;
  color: #fff;
}
.btn-blue:hover { background-color: #036b62; }

.btn-indigo {
  background-color: #4f46e5;
  color: #fff;
}
.btn-indigo:hover { background-color: #4338ca; }

.btn-outline {
  background-color: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
}
.btn-outline:hover { background-color: #f9fafb; }

.btn-ghost {
  background-color: transparent;
  color: #4b5563;
  border: none;
}
.btn-ghost:hover { background-color: #f3f4f6; color: #111827; }

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

/* ── Inputs ─────────────────────────────────────── */
.input-field {
  display: block;
  width: 100%;
  padding: 0.625rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-family: 'Roboto', sans-serif;
  color: #111827;
  background-color: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-field:focus {
  outline: none;
  border-color: #017e72;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.input-field::placeholder { color: #9ca3af; }
textarea.input-field { resize: vertical; }

/* ── Cards ──────────────────────────────────────── */
.card {
  background-color: #fff;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* Card with colored top-accent strip (settings sections) */
.card-section {
  background-color: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  overflow: hidden;
}
.card-section-body { padding: 1.5rem; }

/* ── Badges ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-blue  { background-color: #d4f5ea; color: #036b62; }
.badge-green { background-color: #dcfce7; color: #15803d; }
.badge-amber { background-color: #fef3c7; color: #92400e; }
.badge-red   { background-color: #fee2e2; color: #991b1b; }
.badge-gray  { background-color: #f3f4f6; color: #374151; }

/* ── Progress bar ───────────────────────────────── */
.progress-bar {
  height: 0.5rem;
  background-color: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background-color: #017e72;
  border-radius: 9999px;
  transition: width 0.3s;
}

/* ── Navbar (legacy - public pages) ────────────── */
.top-nav {
  background-color: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 50;
}
.top-nav-inner {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── App nav (dashboard, dark navy) ────────────── */
.app-nav {
  background-color: #09263a;
  position: sticky;
  top: 0;
  z-index: 50;
  height: 3.5rem;
}
.app-nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Sidebar ────────────────────────────────────── */
.app-sidebar {
  width: 16rem;
  background-color: #fff;
  border-right: 1px solid #e9ecf0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

/* Mobile: sidebar slides in from the left. Uses plain transform - no Tailwind CSS-variable dependency. */
@media (max-width: 767px) {
  .app-sidebar {
    transform: translateX(-100%);
    transition: transform 200ms ease;
  }
  .app-sidebar.sidebar-open {
    transform: translateX(0);
  }
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  color: #4b5563;
  transition: background-color 0.12s, color 0.12s;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-weight: 400;
}
.sidebar-item:hover { background-color: #f4f6f9; color: #111827; }
.sidebar-item.active {
  background-color: #09263a;
  color: #fff;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(26,39,68,0.18);
}
.sidebar-item.active svg { color: #5eead4; } /* teal-300 */
.sidebar-item.disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Dashboard tabs ─────────────────────────────── */
.dash-tabs {
  background-color: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 4rem;
  z-index: 40;
}
.dash-tabs-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  gap: 0;
  overflow-x: auto;
}
.dash-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid transparent;
  font-size: 0.875rem;
  font-weight: 400;
  color: #4b5563;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.dash-tab:hover { color: #111827; border-bottom-color: #d1d5db; }
.dash-tab.active { color: #017e72; border-bottom-color: #017e72; font-weight: 500; }
.dash-tab svg { width: 1rem; height: 1rem; }

/* ── Flash messages ─────────────────────────────── */
/* container styles moved to Tailwind in base.html */
.flash-msg {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  animation: slideIn 0.2s ease-out;
}
.flash-msg.success { background-color: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.flash-msg.error   { background-color: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.flash-msg.warning { background-color: #fffbeb; border: 1px solid #fde68a; color: #78350f; }
.flash-msg.info    { background-color: #effcf8; border: 1px solid #aaead6; color: #036b62; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Upload zone ────────────────────────────────── */
.upload-zone {
  border: 2px dashed #d1d5db;
  border-radius: 0.75rem;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.upload-zone:hover { border-color: #017e72; background-color: #effcf8; }
.upload-zone.dragging { border-color: #017e72; background-color: #d4f5ea; }

/* ── Step indicator ─────────────────────────────── */
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.step-num.pending  { background-color: #f3f4f6; color: #6b7280; }
.step-num.active   { background-color: #017e72; color: #fff; }
.step-num.complete { background-color: #22c55e; color: #fff; }

/* ── Spinner ────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 3rem;
  height: 3rem;
  border: 4px solid #e5e7eb;
  border-top-color: #017e72;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── OTP digit input ────────────────────────────── */
.otp-digit {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border: 2px solid #d1d5db;
  border-radius: 0.625rem;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  color: #111827;
  background-color: #f9fafb;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
  caret-color: transparent;
}
.otp-digit:focus {
  outline: none;
  border-color: #017e72;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
  background-color: #effcf8;
}
.otp-digit.otp-filled {
  border-color: #374151;
  background-color: #fff;
}

/* ── Utilities ──────────────────────────────────── */
.divider { border: none; border-top: 2px solid #e5e7eb; margin: 2rem 0; }
.label { display: block; font-size: 0.875rem; font-weight: 500; color: #374151; margin-bottom: 0.375rem; }
.help-text { font-size: 0.75rem; color: #6b7280; margin-top: 0.25rem; }
.section-title { font-size: 1.875rem; font-weight: 700; color: #111827; margin-bottom: 0.5rem; }
.section-sub   { font-size: 1rem; color: #4b5563; }

/* ── Stat card ──────────────────────────────────── */
.stat-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 0.75rem; padding: 1.5rem; }
.stat-label { font-size: 0.875rem; font-weight: 600; color: #374151; margin-bottom: 0.75rem; }
.stat-value { font-size: 1.875rem; font-weight: 700; color: #111827; margin-bottom: 0.25rem; }
.stat-sub   { font-size: 0.875rem; color: #6b7280; margin-bottom: 1rem; }
.stat-divider { border-top: 1px solid #e5e7eb; padding-top: 1rem; }
.stat-detail-label { font-size: 0.75rem; font-weight: 500; color: #374151; margin-bottom: 0.25rem; }
.stat-detail-value { font-size: 0.75rem; color: #6b7280; }

/* ── AI chat markdown ───────────────────────────── */
.ai-message p { margin: 0 0 0.6em; }
.ai-message p:last-child { margin-bottom: 0; }
.ai-message ul, .ai-message ol { margin: 0.4em 0 0.6em 1.25em; }
.ai-message ul { list-style-type: disc; }
.ai-message ol { list-style-type: decimal; }
.ai-message li { margin-bottom: 0.2em; }
.ai-message h1, .ai-message h2, .ai-message h3 {
  font-weight: 600; margin: 0.75em 0 0.35em; line-height: 1.3;
}
.ai-message h1 { font-size: 1.1em; }
.ai-message h2 { font-size: 1.05em; }
.ai-message h3 { font-size: 1em; }
.ai-message code {
  background: #f3f4f6; border-radius: 0.25rem;
  padding: 0.1em 0.35em; font-size: 0.85em; font-family: monospace;
}
.ai-message pre {
  background: #f3f4f6; border-radius: 0.5rem;
  padding: 0.75rem 1rem; overflow-x: auto; margin: 0.5em 0;
}
.ai-message pre code { background: none; padding: 0; }
.ai-message blockquote {
  border-left: 3px solid #d1d5db; padding-left: 0.75rem;
  color: #6b7280; margin: 0.5em 0;
}
.ai-message table {
  display: block; max-width: 100%; overflow-x: auto;
  border-collapse: collapse; margin: 0.5em 0; font-size: 0.95em;
}
.ai-message th, .ai-message td {
  border: 1px solid #e5e7eb; padding: 0.35em 0.6em;
  text-align: left; vertical-align: top;
}
.ai-message th { background: #f9fafb; font-weight: 600; }
.ai-message strong { font-weight: 600; }
.ai-message em { font-style: italic; }
.ai-message a { color: #017e72; text-decoration: underline; }
.ai-message hr { border: none; border-top: 1px solid #e5e7eb; margin: 0.75em 0; }

/* ── Claim card ─────────────────────────────────── */
.claim-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 0.75rem; padding: 1.5rem; transition: box-shadow 0.15s; }
.claim-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

/* ── Accordion (shared) ─────────────────────────── */
.accordion-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
}
.accordion-panel-inner { overflow: hidden; }
.accordion-item.open > .accordion-panel { grid-template-rows: 1fr; }
.accordion-item.open > button .accordion-chevron { transform: rotate(180deg); }

/* ── FAQ accordion ──────────────────────────────── */
.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
}
.faq-panel-inner { overflow: hidden; }
.faq-item.open > .faq-panel { grid-template-rows: 1fr; }
.faq-item.open > button .faq-chevron { transform: rotate(180deg); }

/* ── Navbar logo ────────────────────────────────── */
.logo-simple { display: none; }
.logo-full   { display: block; }
@media (max-width: 370px) {
  .logo-simple { display: block; height: 3.5rem; }
  .logo-full   { display: none; }
}

  /* Open-enrollment step lists: numbers come from a CSS counter so steps that
     render conditionally stay in order without hard-coded digits. */
  .oe-steps { counter-reset: oe-step; }
  .oe-steps > li { counter-increment: oe-step; }
  .oe-step-num::before { content: counter(oe-step); }

  /* Quote Organizer: the inline inputs for filling a person's missing details. */
  .gap-input { height: 2rem; padding: 0 0.5rem; border: 1px solid #fcd34d; border-radius: 0.375rem; font-size: 0.875rem; background: #fff; }
  .gap-input:focus { outline: 2px solid #017e72; outline-offset: 1px; border-color: transparent; }

} /* end @layer components */
