/* ==========================================================================
   Careviqo marketing site — design tokens
   ========================================================================== */
:root {
  --navy: #102A43;
  --navy-light: #14385A;
  --navy-panel: #173554;
  --navy-panel-border: #21466A;
  --teal: #087F8C;
  --teal-tint: #E3F3F2;
  --blue: #3979B8;
  --sage: #39B99A;
  --warning: #F59E0B;
  --ink: #102A43;
  --body: #3E5468;
  --muted: #5B7083;
  --bg: #F7FAFC;
  --surface: #FFFFFF;
  --border: #E2E8F0;

  --container: 1240px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; text-wrap: pretty; }
a { color: var(--teal); text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: 28px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Header / nav
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 250, 252, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 1px 0 rgba(16, 42, 67, 0.02);
}
.site-header__bar {
  display: flex;
  align-items: center;
  gap: 32px;
  padding-block: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.brand img { width: 30px; height: 30px; }
.brand span {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.5px;
  color: var(--navy);
}

.main-nav {
  display: flex;
  gap: 28px;
  flex: 1;
  font-size: 15px;
  font-weight: 500;
}
.main-nav a {
  position: relative;
  color: var(--body);
  padding: 6px 0;
  transition: color 0.15s var(--ease);
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--teal);
  transition: right 0.25s var(--ease);
}
.main-nav a:hover { color: var(--navy); }
.main-nav a:hover::after { right: 0; }

.header-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn-ghost { color: var(--navy); padding: 10px 14px; }
.btn-ghost:hover { color: var(--teal); }
.btn-dark { background: var(--navy); color: #fff; padding: 11px 20px; }
.btn-dark:hover { background: var(--teal); }
.btn-teal { background: var(--teal); color: #fff; padding: 15px 24px; font-size: 16px; }
.btn-teal:hover { background: var(--navy); }
.btn-outline { background: var(--surface); color: var(--navy); border-color: var(--border); padding: 14px 24px; font-size: 16px; }
.btn-outline:hover { border-color: var(--navy); }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-toggle svg { width: 18px; height: 18px; }

@media (max-width: 860px) {
  .main-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 2px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 28px 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s var(--ease);
  }
  .main-nav a { padding: 10px 0; }
  .site-header.nav-open .main-nav { max-height: 320px; }
  .nav-toggle { display: inline-flex; }
  .header-actions .btn-ghost { display: none; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding-block-start: 88px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
}
.eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--sage);
}
.hero__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr));
  gap: 56px;
  align-items: end;
}
.hero h1 {
  font-size: clamp(38px, 6vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 650;
}
.hero__copy { display: flex; flex-direction: column; gap: 28px; padding-bottom: 8px; }
.hero__copy p { font-size: 19px; line-height: 1.6; color: var(--body); max-width: 520px; }
.hero__ctas { display: flex; gap: 12px; flex-wrap: wrap; }

/* Dashboard preview panel */
.preview {
  margin-top: 64px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-light) 100%);
  padding: clamp(14px, 3vw, 36px) clamp(14px, 3vw, 36px) 0;
  overflow: hidden;
}
.preview__inner {
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  min-height: 520px;
  overflow: hidden;
}
.preview__sidebar {
  background: var(--navy);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--navy-panel-border);
}
.preview__sidebar-brand {
  display: flex; align-items: center; gap: 8px;
  padding: 0 8px 18px;
  color: #fff; font-weight: 650; font-size: 15px; letter-spacing: -0.3px;
}
.preview__sidebar-brand img { width: 20px; height: 20px; }
.preview__navitem {
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #A9BCCD;
}
.preview__navitem.is-active { color: #fff; background: var(--teal); }

.preview__main {
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--bg);
  min-width: 0;
}
.preview__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.preview__head-title { font-size: 20px; font-weight: 650; letter-spacing: -0.4px; }
.preview__head-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.preview__live {
  font-size: 12px; font-weight: 600; color: var(--teal);
  background: var(--teal-tint); padding: 7px 12px; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 6px;
}
.preview__live .blip {
  width: 6px; height: 6px; border-radius: 50%; background: var(--sage);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-tile .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat-tile .value { font-size: 24px; font-weight: 650; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.stat-tile .note { font-size: 12px; font-weight: 500; }
.note--up { color: #1E8F6E; }
.note--flat { color: var(--muted); }

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.panel-card__head { display: flex; justify-content: space-between; font-size: 13px; }
.panel-card__head span:first-child { font-weight: 600; }
.panel-card__head span:last-child { color: var(--muted); }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 140px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; height: 100%; }
.bar__opd, .bar__ipd { border-radius: 4px 4px 0 0; transform: scaleY(0); transform-origin: bottom; transition: transform 0.6s var(--ease); }
.bar__ipd { background: var(--blue); opacity: 0.85; border-radius: 4px 4px 0 0; }
.bar__opd { background: var(--sage); border-radius: 0 0 4px 4px; }
.is-visible .bar__opd, .is-visible .bar__ipd { transform: scaleY(1); }
.bar__label { font-size: 11px; color: var(--muted); text-align: center; padding-top: 4px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

.appt-list { display: flex; flex-direction: column; }
.appt-list__title { font-size: 13px; font-weight: 600; padding-bottom: 8px; }
.appt-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid #EEF2F6;
  font-size: 13px;
}
.appt-row .time { color: var(--muted); font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.appt-row .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.appt-row .who strong { font-weight: 600; }
.appt-row .who small { color: var(--muted); font-size: 12px; }
.appt-row .status { font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 6px; justify-self: start; }
.status--confirmed { color: #0B6B4F; background: #E2F6EE; }
.status--pending { color: #8A5A00; background: #FDF1DC; }

@media (max-width: 720px) {
  .preview__inner { grid-template-columns: 1fr; }
  .preview__sidebar { display: none; }
}

/* ==========================================================================
   Outcomes strip
   ========================================================================== */
.outcomes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}
.outcome {
  background: var(--surface);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.outcome .value { font-size: 40px; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.outcome .label { font-size: 15px; color: var(--body); line-height: 1.5; }

/* ==========================================================================
   Section heading
   ========================================================================== */
.section-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
  margin-bottom: 48px;
}
.section-head h2 {
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 650;
}

/* ==========================================================================
   Platform tabs
   ========================================================================== */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 24px;
  align-items: stretch;
}
.tab-list { display: flex; flex-direction: column; gap: 8px; }
.tab-btn {
  text-align: left;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--navy);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.tab-btn .t { font-size: 18px; font-weight: 600; letter-spacing: -0.2px; }
.tab-btn .d { font-size: 15px; line-height: 1.55; color: var(--body); }
.tab-btn.is-active { border-color: var(--teal); background: var(--surface); }

.tab-panel {
  background: var(--navy);
  border-radius: 20px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  color: #fff;
  min-height: 420px;
}
.tab-panel__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tab-panel__head .title { font-size: 20px; font-weight: 600; }
.tab-panel__head .tag { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: #9FC9D0; letter-spacing: 0.04em; }
.tab-panel__rows { display: flex; flex-direction: column; gap: 10px; }
.tab-panel__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: var(--navy-panel);
  border: 1px solid var(--navy-panel-border);
  border-radius: 12px;
  padding: 14px 16px;
}
.tab-panel__row .who { display: flex; flex-direction: column; gap: 3px; }
.tab-panel__row .who strong { font-size: 15px; font-weight: 600; }
.tab-panel__row .who small { font-size: 13px; color: #A9BCCD; }
.tab-panel__row .pill { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 7px; color: #0B3B3F; }
.tab-panel__foot {
  margin-top: auto; font-size: 14px; color: #A9BCCD; line-height: 1.6;
  border-top: 1px solid var(--navy-panel-border); padding-top: 18px;
}

/* ==========================================================================
   Modules
   ========================================================================== */
.modules-section { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.modules-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 48px;
}
.modules-head .section-head { margin-bottom: 0; max-width: 640px; }
.modules-head > p { font-size: 17px; line-height: 1.6; color: var(--body); max-width: 380px; }
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.module-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.module-card:hover { border-color: var(--teal); background: var(--surface); transform: translateY(-2px); }
.module-card__head { display: flex; align-items: center; justify-content: space-between; }
.module-card__head .n { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); }
.module-card__head .dot { width: 10px; height: 10px; border-radius: 3px; }
.module-card .t { font-size: 18px; font-weight: 600; letter-spacing: -0.2px; }
.module-card .d { font-size: 15px; line-height: 1.55; color: var(--body); }

/* ==========================================================================
   Security
   ========================================================================== */
.security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 56px;
  align-items: start;
}
.security-intro { display: flex; flex-direction: column; gap: 20px; }
.security-intro p { font-size: 17px; line-height: 1.6; color: var(--body); max-width: 460px; }
@media (min-width: 900px) {
  .security-intro { position: sticky; top: 110px; }
}
.security-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 20px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
}
.security-item .n { font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--teal); padding-top: 3px; }
.security-item .t { font-size: 19px; font-weight: 600; letter-spacing: -0.2px; }
.security-item .d { font-size: 16px; line-height: 1.6; color: var(--body); margin-top: 8px; }

/* ==========================================================================
   Mobile app showcase
   ========================================================================== */
.mobile-section {
  background: var(--navy);
  border-radius: 28px;
  padding: clamp(32px, 5vw, 72px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 48px;
  align-items: center;
  color: #fff;
}
.mobile-copy { display: flex; flex-direction: column; gap: 22px; }
.mobile-copy h2 { font-size: clamp(28px, 3.6vw, 46px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 650; }
.mobile-copy p { font-size: 17px; line-height: 1.6; color: #B8C8D6; max-width: 480px; }
.mobile-copy .browser-support { font-size: 14px; color: #8AA0B5; }

.phone-wrap { display: flex; justify-content: center; }
.phone {
  width: 270px;
  border-radius: 40px;
  background: #0A1C2E;
  padding: 12px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
}
.phone__screen {
  border-radius: 30px;
  background: var(--bg);
  color: var(--navy);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 500px;
}
.phone__statusbar { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; }
.phone__statusbar .notch { width: 64px; height: 18px; border-radius: 10px; background: #0A1C2E; }
.phone__brand { display: flex; align-items: center; gap: 8px; }
.phone__brand img { width: 20px; height: 20px; }
.phone__brand span { font-weight: 650; font-size: 15px; letter-spacing: -0.3px; }
.phone__title { font-size: 18px; font-weight: 650; letter-spacing: -0.3px; line-height: 1.2; }
.ward-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.ward-item .who { display: flex; flex-direction: column; gap: 2px; }
.ward-item .who strong { font-size: 13px; font-weight: 600; }
.ward-item .who small { font-size: 12px; color: var(--muted); }
.ward-item .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.phone__cta { margin-top: auto; background: var(--teal); color: #fff; text-align: center; border-radius: 12px; padding: 12px; font-size: 14px; font-weight: 600; }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: clamp(28px, 5vw, 64px);
}
.contact-copy { display: flex; flex-direction: column; gap: 18px; }
.contact-copy h2 { font-size: clamp(28px, 3.6vw, 46px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 650; }
.contact-copy p { font-size: 17px; line-height: 1.6; color: var(--body); }

.contact-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.contact-form input, .contact-form select {
  font: inherit;
  font-size: 15px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--navy);
  width: 100%;
}
.contact-form input:focus, .contact-form select:focus {
  outline: 2px solid var(--teal);
  outline-offset: -1px;
}
.contact-form button {
  grid-column: 1 / -1;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--navy);
  border: 0;
  border-radius: 12px;
  padding: 16px;
}
.contact-form button:hover { background: var(--teal); }
.contact-form button:disabled { opacity: 0.6; cursor: not-allowed; }
.contact-form .form-error { grid-column: 1 / -1; font-size: 14px; color: #B42318; margin: 0; }

.contact-success {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
  background: var(--teal-tint);
  border-radius: 18px;
  padding: 32px;
  animation: fade-up 0.4s var(--ease) both;
}
.contact-success .title { font-size: 22px; font-weight: 650; }
.contact-success .sub { font-size: 16px; color: var(--body); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--navy); color: #B8C8D6; }
.footer-top { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-brand { display: flex; flex-direction: column; gap: 12px; }
.footer-brand .row { display: flex; align-items: center; gap: 10px; }
.footer-brand img { width: 28px; height: 28px; }
.footer-brand span.name { font-size: 20px; font-weight: 650; letter-spacing: -0.5px; color: #fff; }
.footer-brand .tagline { font-size: 14px; }
.footer-links { display: flex; gap: 56px; flex-wrap: wrap; font-size: 14px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col .heading { color: #fff; font-weight: 600; }
.footer-col a { color: #B8C8D6; transition: color 0.15s var(--ease); }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid var(--navy-panel-border);
  padding-top: 24px;
  margin-top: 40px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Sections rhythm
   ========================================================================== */
section { padding-block: 72px; }
#top { padding-top: 88px; }
#platform { padding-bottom: 96px; }
.modules-section .container { padding-block: 96px; }
#security { padding-block: 96px; }

/* ==========================================================================
   Scroll-reveal
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Hero brand-mark entrance (the one signature moment)
   ========================================================================== */
.hero-mark { width: 52px; height: 52px; }
.hero-mark path {
  opacity: 0;
  transform: scale(0.5) translateY(6px);
  transform-origin: 110px 110px;
  animation: leaf-in 0.7s var(--ease) both;
}

@keyframes leaf-in {
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
