html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* asp-validation-summary renders the wrapper even when there are no errors;
   hide it so forms don't show an empty pink banner on first load. */
.validation-summary-valid {
  display: none;
}

/* Wizard upcoming-step pill: bg-light + Bootstrap text-secondary (#6c757d) is
   4.45:1 — below WCAG AA 4.5 for normal text. Use gray-700 to clear AA. */
.wizard-step--upcoming {
  background-color: #f8f9fa;
  color: #495057;
  border: 1px solid #dee2e6;
}

/* Clickable wizard step rail: let users jump straight to any section. */
.wizard-step-link { cursor: pointer; }
.wizard-step-link .small { color: #495057; transition: color .12s ease; }
.wizard-step-link:hover .small,
.wizard-step-link:focus-visible .small { color: #0f7a55; text-decoration: underline; }
.wizard-step-link:focus-visible { outline: 2px solid #15936b; outline-offset: 2px; border-radius: 8px; }

/* ---------- Site footer ---------- */

.site-footer {
  background: #f7f9fa;
  color: #495057;
}

.site-footer a {
  color: #495057;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus {
  color: #0d6efd;
  text-decoration: underline;
}

.site-footer__assurance {
  font-size: 0.95rem;
  color: #212529;
}

.site-footer__heading {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #212529;
  margin-bottom: 0.75rem;
}

.site-footer ul li {
  margin-bottom: 0.35rem;
  line-height: 1.5;
}

/* ---------- Responsive "stacked card" table (opt-in via .table-stack-sm) ---------- */

@media (max-width: 767.98px) {
  .table-stack-sm,
  .table-stack-sm thead,
  .table-stack-sm tbody,
  .table-stack-sm tr,
  .table-stack-sm td {
    display: block;
    width: 100%;
  }
  .table-stack-sm thead {
    position: absolute;
    top: -10000px;
    left: -10000px;
    visibility: hidden;
  }
  .table-stack-sm tbody tr {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: #ffffff;
  }
  .table-stack-sm tbody td {
    border: none;
    padding: 0.4rem 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    word-break: break-word;
  }
  .table-stack-sm tbody td::before {
    content: attr(data-label);
    flex: 0 0 8rem;
    font-weight: 600;
    color: #495057;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }
  .table-stack-sm tbody td:not([data-label])::before { content: ""; }
  /* Actions row: stack as full-width buttons. */
  .table-stack-sm tbody td[data-label="Actions"] {
    flex-direction: column;
    align-items: stretch;
    padding-top: 0.5rem;
    margin-top: 0.4rem;
    border-top: 1px solid #f1f3f5;
  }
  .table-stack-sm tbody td[data-label="Actions"]::before {
    margin-bottom: 0.5rem;
  }
  .table-stack-sm tbody td[data-label="Actions"] .btn,
  .table-stack-sm tbody td[data-label="Actions"] form,
  .table-stack-sm tbody td[data-label="Actions"] form button {
    width: 100%;
  }
}

/* ---------- Public landing page ---------- */

.landing-hero {
  padding: 4.5rem 0 3.5rem;
  text-align: center;
}

.landing-hero__inner {
  max-width: 720px;
  margin: 0 auto;
}

.landing-eyebrow {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0d6efd;
  margin-bottom: 0.75rem;
}

.landing-hero__title {
  font-size: clamp(2rem, 4vw + 1rem, 3rem);
  line-height: 1.15;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #212529;
}

.landing-hero__sub {
  font-size: 1.125rem;
  line-height: 1.6;
  color: #495057;
  margin-bottom: 2rem;
}

.landing-hero__ctas {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.landing-hero__ctas .btn {
  padding-inline: 1.5rem;
}

.landing-hero__reassure {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 0;
}

.landing-section {
  padding: 3.5rem 0;
}

.landing-section--alt {
  background: #f7f9fa;
  margin-inline: calc(50% - 50vw);
  padding-inline: max(1rem, calc(50vw - 50%));
}

.landing-section__head {
  max-width: 680px;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.landing-section__head h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.landing-section__lead {
  font-size: 1.05rem;
  color: #495057;
  margin-bottom: 0;
}

.landing-feature {
  height: 100%;
  padding: 1.75rem;
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
}

.landing-feature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #e7f0ff;
  color: #0d6efd;
  margin-bottom: 1rem;
}

.landing-feature h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.landing-feature p {
  color: #495057;
  margin-bottom: 0;
  line-height: 1.55;
}

.landing-steps {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.landing-steps > li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.landing-steps__num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #0d6efd;
  color: #fff;
  font-weight: 700;
}

.landing-steps h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.landing-steps p {
  color: #495057;
  margin-bottom: 0;
  line-height: 1.5;
}

.landing-trust h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.landing-trust p {
  color: #495057;
  margin-bottom: 0;
  line-height: 1.55;
}

.landing-faq {
  max-width: 720px;
  margin: 0 auto;
}

.landing-faq details {
  border-top: 1px solid #e9ecef;
  padding: 1rem 0;
}

.landing-faq details:last-child {
  border-bottom: 1px solid #e9ecef;
}

.landing-faq summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 1.5rem;
}

.landing-faq summary::-webkit-details-marker {
  display: none;
}

.landing-faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  line-height: 1;
  color: #6c757d;
}

.landing-faq details[open] summary::after {
  content: "\2013";
}

.landing-faq p {
  margin: 0.75rem 0 0;
  color: #495057;
  line-height: 1.6;
}

.landing-cta {
  text-align: center;
  padding: 4rem 1rem;
}

.landing-cta h2 {
  font-size: clamp(1.4rem, 2vw + 0.8rem, 1.9rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.3;
}

.landing-cta__sub {
  margin-top: 1rem;
  color: #6c757d;
}
/* ---------- Care record (Phase 2-A: section explorer) ---------- */
.record-head {
  background: #fff;
  border: 1px solid #e6e9ec;
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .05);
  margin-bottom: 22px;
}
.record-head__row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.record-head__avatar {
  width: 64px; height: 64px; border-radius: 16px; flex-shrink: 0;
  background: linear-gradient(135deg, #1aa97c, #0f7a55);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 22px; object-fit: cover;
}
.record-head__name { font-size: 1.6rem; font-weight: 700; margin: 0; line-height: 1.15; }
.record-head__meta { color: #6b7280; font-size: .9rem; margin-top: 3px; }
.record-head__alerts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.record-chip { background: #fde8e8; color: #b91c1c; border-radius: 9px; padding: 6px 11px; font-size: .8rem; font-weight: 600; }

.record-shell { display: grid; grid-template-columns: 240px 1fr; gap: 22px; align-items: start; }
.record-explorer {
  background: #fff; border: 1px solid #e6e9ec; border-radius: 16px; padding: 10px;
  position: sticky; top: 16px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.record-explorer__grp {
  font-size: .68rem; letter-spacing: .07em; text-transform: uppercase;
  color: #6b7280; font-weight: 700; padding: 12px 12px 5px;
}
.record-sx {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  font-size: .92rem; font-weight: 500; color: #374151; text-decoration: none; cursor: pointer;
}
.record-sx:hover { background: #f3f6f4; color: #0f7a55; }
.record-sx.is-active { background: #e9f6ef; color: #0f7a55; font-weight: 700; }
.record-sx > span:first-child { flex: 1; }
.record-sx__tick { font-size: .8rem; }
.record-sx__tick.done { color: #15936b; }
.record-sx__tick.miss { color: #c2cbc6; }

.record-panel {
  background: #fff; border: 1px solid #e6e9ec; border-radius: 16px; padding: 22px 24px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .05); margin-bottom: 18px;
}
.record-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.record-panel dt { font-weight: 600; color: #6b7280; }
/* Single-panel mode is enabled by JS; without JS every panel shows (graceful fallback). */
.record-shell[data-mode="explorer"] .record-panel { display: none; margin-bottom: 0; }
.record-shell[data-mode="explorer"] .record-panel.is-active { display: block; }

@media (max-width: 991.98px) {
  .record-shell { grid-template-columns: 1fr; }
  .record-explorer { position: static; display: flex; gap: 4px; overflow-x: auto; padding: 8px; margin-bottom: 4px; }
  .record-explorer__grp { display: none; }
  .record-sx { white-space: nowrap; }
  .record-sx__tick { display: none; }
}
