/* ══════════════════════════════════════════════════════════════
   LifeKey — style.css
   Sections:
   01. CSS variables
   02. Reset & base
   03. Shared utilities / helpers
   04. Buttons
   05. Forms (inputs, labels, messages)
   06. Landing nav
   07. Hero section
   08. Features section
   09. How It Works section
   10. CTA + Footer
  11. Auth screen (split layout)
  12. App nav (top bar)
  13. App main content / sections
  14. Dashboard
  15. Medical card
  16. Reports
  17. Print styles  ← critical
  18. Responsive / mobile
══════════════════════════════════════════════════════════════ */

/* ── 01. CSS Variables ──────────────────────────────────────── */
:root {
  /* Brand colours */
  --teal:          #0d9488;
  --teal-dark:     #0f766e;
  --teal-light:    #f0fdfa;
  --teal-mid:      #ccfbf1;
  --navy:          #1e3a5f;
  --navy-light:    #2d4f7c;

  /* Neutrals */
  --white:         #ffffff;
  --bg:            #f8fafc;
  --surface:       #ffffff;
  --surface-alt:   #f1f5f9;
  --border:        #e2e8f0;
  --border-strong: #cbd5e1;

  /* Text */
  --text:          #0f172a;
  --text-body:     #334155;
  --muted:         #64748b;
  --muted-light:   #94a3b8;

  /* Status */
  --success:       #16a34a;
  --success-bg:    #f0fdf4;
  --success-border:#86efac;
  --error:         #dc2626;
  --error-bg:      #fef2f2;
  --error-border:  #fca5a5;
  --warn:          #b45309;
  --warn-bg:       #fffbeb;
  --warn-border:   #fcd34d;
  --info-bg:       #eff6ff;
  --info-text:     #1d4ed8;
  --info-border:   #93c5fd;

  /* Radii & shadows */
  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     16px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:        0 4px 12px rgba(0,0,0,.08);
  --shadow-md:     0 8px 24px rgba(0,0,0,.10);
  --shadow-lg:     0 20px 48px rgba(0,0,0,.12);

  /* Layout */
  --max-w:         1080px;
  --nav-h:         60px;
}

/* ── 02. Reset & base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, "Segoe UI", system-ui, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.65;
  min-height: 100vh;
}

h1, h2, h3 { color: var(--text); line-height: 1.25; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }
img, svg { display: block; }

/* ── 03. Shared utilities ───────────────────────────────────── */
.hidden   { display: none !important; }

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-header h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: .6rem;
}
.section-header p {
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto;
}
.section-eyebrow {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--teal);
  background: var(--teal-mid);
  padding: .25rem .75rem;
  border-radius: 99px;
  margin-bottom: .9rem;
}

/* App section headings */
.section-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: .3rem;
}
.section-sub {
  color: var(--muted);
  margin-bottom: 2rem;
  font-size: .93rem;
}
.sub-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1rem;
}

/* ── 04. Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .6rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s, opacity .15s, transform .1s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.btn:disabled      { opacity: .55; cursor: not-allowed; }
.btn svg           { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.btn-primary:hover:not(:disabled) { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn-primary:active:not(:disabled){ transform: translateY(1px); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-outline:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-alt); color: var(--text); }

.btn-danger {
  background: var(--error-bg);
  color: var(--error);
  border-color: var(--error-border);
}
.btn-danger:hover:not(:disabled) { background: var(--error-border); }

.btn-full { width: 100%; }
.btn-sm   { padding: .4rem .85rem; font-size: .82rem; }
.btn-lg   { padding: .75rem 1.75rem; font-size: 1rem; border-radius: var(--radius-sm); }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--teal);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.link-btn:hover { color: var(--teal-dark); }

/* ── 05. Forms ──────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-bottom: 1.1rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  font-size: .84rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: .01em;
}
.required { color: var(--error); margin-left: .1rem; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: .6rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  line-height: 1.5;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,148,136,.12);
}
input::placeholder, textarea::placeholder { color: var(--muted-light); }
textarea { resize: vertical; }
select   { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .85rem center; padding-right: 2rem; }

.form-actions {
  display: flex;
  gap: .75rem;
  margin-top: .5rem;
  flex-wrap: wrap;
}
.field-hint { font-size: .77rem; color: var(--muted); margin-top: -.2rem; }

/* Form messages */
.form-message {
  font-size: .86rem;
  padding: .65rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: .85rem;
  display: none;
}
.form-message.error   { display:block; background:var(--error-bg);   color:var(--error);   border:1px solid var(--error-border); }
.form-message.success { display:block; background:var(--success-bg); color:var(--success); border:1px solid var(--success-border); }
.form-message.info    { display:block; background:var(--info-bg);    color:var(--info-text); border:1px solid var(--info-border); }

/* Fieldset grouping inside profile form */
.form-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem 0.25rem;
  margin-bottom: 1.25rem;
}
.fieldset-legend {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--teal-dark);
  padding: 0 .5rem;
  background: var(--white);
}

/* Card-style form container */
.card-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.75rem;
}

/* Progress bar */
.progress-bar {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: .85rem;
}
#upload-bar {
  height: 100%;
  width: 0%;
  background: var(--teal);
  border-radius: 3px;
  transition: width .3s;
}

/* File drop zone */
.file-drop-zone {
  position: relative;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--surface-alt);
}
.file-drop-zone:hover { border-color: var(--teal); background: var(--teal-light); }
.file-drop-zone svg   { width: 28px; height: 28px; color: var(--muted); margin: 0 auto .6rem; }
.file-drop-zone p     { font-weight: 600; color: var(--text); font-size: .9rem; margin-bottom: .25rem; }
.file-drop-zone span  { font-size: .78rem; color: var(--muted); }
.file-drop-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
  width: 100%; height: 100%; border: none;
}
.file-chosen {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .5rem;
  font-size: .84rem;
  color: var(--teal-dark);
  background: var(--teal-light);
  border: 1px solid var(--teal-mid);
  border-radius: var(--radius-sm);
  padding: .4rem .75rem;
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}
.empty-state h3 { color: var(--text); margin-bottom: .4rem; font-size: 1.05rem; }
.empty-state p  { margin-bottom: 1.25rem; font-size: .9rem; max-width: 320px; margin-left: auto; margin-right: auto; }
.empty-icon-wrap {
  width: 64px; height: 64px;
  background: var(--surface-alt);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
}
.empty-icon-wrap svg { width: 28px; height: 28px; color: var(--muted-light); }

/* ── 06. Landing nav ────────────────────────────────────────── */
.lnav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.lnav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 2rem;
}
.lnav-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--navy);
  text-decoration: none;
  flex-shrink: 0;
}
.lnav-brand:hover { text-decoration: none; color: var(--teal); }
.brand-icon { width: 22px; height: 22px; color: var(--teal); }

.lnav-links {
  display: flex;
  gap: .25rem;
  flex: 1;
}
.lnav-links a {
  font-size: .88rem;
  font-weight: 500;
  color: var(--muted);
  padding: .4rem .75rem;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
  text-decoration: none;
}
.lnav-links a:hover { color: var(--text); background: var(--surface-alt); }

.lnav-actions { display: flex; align-items: center; gap: .5rem; }

/* Mobile */
.lnav-mobile {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: .75rem 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.lnav-mobile a {
  font-size: .93rem;
  font-weight: 500;
  color: var(--text-body);
  padding: .5rem .25rem;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.lnav-mobile a:last-of-type { border-bottom: none; margin-bottom: .25rem; }
.lnav-mobile .btn { width: 100%; justify-content: center; margin-top: .25rem; }

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: .25rem;
  margin-left: auto;
}
.hamburger svg { width: 22px; height: 22px; }

/* ── 07. Hero ───────────────────────────────────────────────── */
.hero {
  background: var(--white);
  padding: 5rem 0 5rem;
  border-bottom: 1px solid var(--border);
  overflow: visible; /* allow floating badges to overflow */
}
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
}
.hero-label {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--teal);
  background: var(--teal-mid);
  padding: .3rem .85rem;
  border-radius: 99px;
  margin-bottom: 1.25rem;
}
.hero-heading {
  font-size: 2.75rem;
  font-weight: 900;
  color: var(--navy);
  line-height: 1.15;
  margin-bottom: 1.1rem;
  letter-spacing: -.03em;
}
.hero-desc {
  font-size: 1rem;
  color: var(--muted);
  max-width: 440px;
  margin-bottom: 2rem;
  line-height: 1.7;
}
.hero-cta {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.hero-reassure {
  font-size: .8rem;
  color: var(--muted-light);
}

/* ── Hero visual — product mockup ── */
.hero-visual {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  /* Extra padding so the absolutely-positioned floating badges are not clipped */
  padding: 20px 24px 24px;
}

/* Outer scene container — provides the recessed background plane */
.hv-scene {
  position: relative;
  width: 100%;
  max-width: 400px;
}

/* App window chrome — looks like a real app window */
.hv-app-frame {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow:
    0 2px 4px rgba(0,0,0,.04),
    0 8px 24px rgba(0,0,0,.08),
    0 32px 64px rgba(0,0,0,.10);
  overflow: hidden;
}

/* Title bar with three coloured dots (like macOS) */
.hv-app-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.hv-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.hv-dot-r { background: #ff5f57; }
.hv-dot-y { background: #febc2e; }
.hv-dot-g { background: #28c840; }
.hv-app-title {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  margin-left: .35rem;
  letter-spacing: .01em;
}

/* Card wrapper — light grey inset area */
.hv-card-wrap {
  background: #f1f5f9;
  padding: 1.25rem 1.25rem 1rem;
}

/* ── The medical card itself ── */
.hv-card {
  position: relative;
  background: linear-gradient(135deg, #0f766e 0%, #134e7a 55%, #1e3a5f 100%);
  border-radius: 12px;
  padding: 16px 18px;
  color: #fff;
  overflow: hidden;
  /* A subtle physical depth effect */
  box-shadow:
    0 1px 2px rgba(0,0,0,.12),
    0 6px 16px rgba(15,118,110,.3),
    inset 0 1px 0 rgba(255,255,255,.12);
}

/* Decorative radial glow on the card — top-right corner */
.hv-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(255,255,255,.12) 0%, transparent 70%);
  pointer-events: none;
}

/* Top strip: brand + chip */
.hv-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.hv-card-brand {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .02em;
  opacity: .95;
}
.hv-card-brand svg { width: 14px; height: 14px; color: #99f6e4; }
.hv-card-chip svg  { width: 28px; height: 22px; }

/* Middle: name + DOB */
.hv-card-mid {
  margin-bottom: 14px;
}
.hv-card-name {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .01em;
  margin-bottom: 2px;
}
.hv-card-dob {
  font-size: .65rem;
  opacity: .65;
  letter-spacing: .04em;
  font-weight: 500;
}

/* Bottom strip: data pills + QR */
.hv-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
}
.hv-card-data {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

/* Each pill is a mini info row */
.hv-pill {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hv-pill-label {
  font-size: .58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .6;
  min-width: 44px;
}
.hv-pill-val {
  font-size: .7rem;
  font-weight: 700;
  background: rgba(255,255,255,.14);
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}
.hv-pill.blood .hv-pill-val {
  background: rgba(252,211,77,.22);
  color: #fde68a;
  font-size: .82rem;
  font-weight: 900;
}

/* QR code in the card bottom-right */
.hv-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.hv-qr svg { width: 54px; height: 54px; }
.hv-scan-label {
  font-size: .52rem;
  opacity: .55;
  text-align: center;
  letter-spacing: .04em;
  white-space: nowrap;
}

/* Watermark text across the card */
.hv-card-watermark {
  position: absolute;
  bottom: 10px; right: 14px;
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: .2em;
  color: rgba(255,255,255,.04);
  pointer-events: none;
  user-select: none;
}

/* ── Mini reports list below the card, inside the frame ── */
.hv-reports {
  padding: .85rem 1.25rem 1.1rem;
  border-top: 1px solid var(--border);
}
.hv-reports-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: .65rem;
}
.hv-report-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .45rem 0;
  border-bottom: 1px solid var(--border);
}
.hv-report-row:last-child { border-bottom: none; }
.hv-report-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-teal { background: var(--teal); }
.dot-navy { background: var(--navy-light); }
.hv-report-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.hv-report-name {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hv-report-meta {
  font-size: .68rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hv-report-badge {
  font-size: .62rem;
  font-weight: 700;
  color: var(--teal-dark);
  background: var(--teal-mid);
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
  letter-spacing: .04em;
}

/* ── Floating notification badges ── */
.hv-badge {
  position: absolute;
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .55rem .85rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.10);
  white-space: nowrap;
  pointer-events: none;
}
.hv-badge svg {
  width: 20px; height: 20px;
  flex-shrink: 0;
}
.hv-badge-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1px;
}
.hv-badge-sub {
  font-size: .66rem;
  color: var(--muted);
}

/* QR badge — peeks out from the top-right */
.hv-badge-qr {
  top: -14px;
  right: -18px;
}
.hv-badge-qr svg { color: var(--teal); }

/* Profile badge — bottom-left */
.hv-badge-profile {
  bottom: -14px;
  left: -18px;
}
.hv-badge-profile svg { color: var(--success); }

/* ── 08. Features section ───────────────────────────────────── */
.features-section {
  padding: 5rem 0;
  background: var(--bg);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  transition: box-shadow .2s, transform .2s;
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.feature-card h3    { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin: 1rem 0 .5rem; }
.feature-card p     { font-size: .88rem; color: var(--muted); line-height: 1.65; }

.feature-icon-wrap {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
}
.feature-icon-wrap svg { width: 22px; height: 22px; }
.feature-icon-wrap.teal  { background: var(--teal-mid); color: var(--teal-dark); }
.feature-icon-wrap.navy  { background: #dbeafe; color: var(--navy); }

/* ── 09. How It Works ───────────────────────────────────────── */
.hiw-section {
  padding: 5rem 0;
  background: var(--white);
  border-top: 1px solid var(--border);
}
.hiw-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.hiw-step {
  flex: 1;
  text-align: center;
  padding: 0 1.5rem;
}
.step-number {
  width: 48px; height: 48px;
  background: var(--navy);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.1rem;
}
.hiw-step h3 { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: .5rem; }
.hiw-step p  { font-size: .87rem; color: var(--muted); line-height: 1.65; }
.hiw-connector {
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
}
.hiw-connector svg { width: 40px; }

/* ── 10. CTA + Footer ───────────────────────────────────────── */
.cta-section {
  padding: 5rem 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.cta-inner {
  text-align: center;
}
.cta-inner h2 { font-size: 2rem; font-weight: 800; color: var(--navy); margin-bottom: .75rem; }
.cta-inner p  { color: var(--muted); margin-bottom: 2rem; font-size: .95rem; }

.site-footer {
  background: var(--navy);
  padding: 2.5rem 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .75rem;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #fff;
  font-size: 1.05rem;
}
.footer-brand svg { color: var(--teal-mid); }
.footer-desc   { font-size: .84rem; color: rgba(255,255,255,.55); max-width: 480px; }

/* ── 11. Auth screen ────────────────────────────────────────── */
.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* Left branding panel */
.auth-panel-left {
  background: linear-gradient(160deg, #0d9488 0%, #1e3a5f 100%);
  padding: 2.5rem 3rem;
  display: flex;
  flex-direction: column;
  color: #fff;
  position: relative;
}
.auth-back-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.85);
  padding: .4rem .85rem;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
  margin-bottom: auto;
  font-family: inherit;
  transition: background .15s;
}
.auth-back-btn:hover { background: rgba(255,255,255,.2); }
.auth-back-btn svg   { width: 16px; height: 16px; }

.auth-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  margin-top: 3rem;
  margin-bottom: 1.25rem;
}
.auth-brand-icon { width: 28px; height: 28px; color: #99f6e4; }

.auth-panel-heading {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 2rem;
}
.auth-perks {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.auth-perks li {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: .9rem;
  color: rgba(255,255,255,.85);
}
.auth-perks li svg { width: 18px; height: 18px; color: #6ee7b7; flex-shrink: 0; }

/* Right forms panel */
.auth-panel-right {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
}
.auth-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 400px;
  overflow: hidden;
}
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: 1rem;
  border: none;
  background: var(--surface-alt);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
  transition: background .15s, color .15s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.auth-tab:hover  { background: var(--white); color: var(--text); }
.auth-tab.active { background: var(--white); color: var(--teal); border-bottom-color: var(--teal); }

.auth-form { padding: 1.75rem 2rem 2rem; }
.auth-switch {
  margin-top: 1rem;
  text-align: center;
  font-size: .84rem;
  color: var(--muted);
}

/* ── 12. App nav ────────────────────────────────────────────── */
.topnav {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.topnav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  flex-shrink: 0;
  text-decoration: none;
}
.nav-brand .brand-icon { color: #99f6e4; }
.logo-text { color: #fff; }

.nav-links {
  display: flex;
  flex: 1;
  list-style: none;
  gap: .1rem;
}
.nav-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.65);
  font-size: .86rem;
  font-weight: 500;
  padding: .45rem .85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-btn:hover  { background: rgba(255,255,255,.1); color: #fff; }
.nav-btn.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }

.nav-user {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}
.nav-user-avatar {
  width: 30px; height: 30px;
  background: var(--teal);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}
.user-email {
  font-size: .78rem;
  color: rgba(255,255,255,.5);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-user .btn-ghost {
  color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.15);
  padding: .35rem .8rem;
}
.nav-user .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }

/* Mobile menu */
.mobile-menu {
  background: #162f50;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
}
.mobile-menu button {
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  text-align: left;
  padding: .85rem 1.5rem;
  font-size: .93rem;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: background .15s;
}
.mobile-menu button:last-child { border-bottom: none; }
.mobile-menu button:hover { background: rgba(255,255,255,.07); }

/* ── 13. App main content ───────────────────────────────────── */
.main-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}
.app-section { animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

/* ── 14. Dashboard ──────────────────────────────────────────── */
.dash-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}
.dash-hero-actions .btn svg { width: 15px; height: 15px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: box-shadow .15s, transform .15s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-icon-wrap {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon-wrap svg { width: 20px; height: 20px; }
.stat-icon-wrap.teal { background: var(--teal-mid);  color: var(--teal-dark); }
.stat-icon-wrap.navy { background: #dbeafe; color: var(--navy); }

.stat-body { flex: 1; min-width: 0; }
.stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .2rem; font-weight: 600; }
.stat-value { font-size: 1rem; font-weight: 700; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stat-arrow { color: var(--muted-light); }
.stat-arrow svg { width: 18px; height: 18px; }

/* Quick actions */
.quick-actions { margin-bottom: 1.5rem; }
.qa-grid {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.qa-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s, color .15s;
}
.qa-btn svg { width: 16px; height: 16px; color: var(--teal); }
.qa-btn:hover { border-color: var(--teal); color: var(--teal); box-shadow: var(--shadow-sm); }

/* ── 15. Medical Card — Calm Care design ───────────────────── */

/*
  CALM CARE PALETTE
  --cc-ivory:      #f7f5f0  — card face background
  --cc-sage:       #7a9e87  — primary brand accent
  --cc-sage-light: #c8dccf  — subtle tints, borders
  --cc-sage-pale:  #eef4f0  — very light background tones
  --cc-ink:        #2c3e35  — primary text
  --cc-ink-mid:    #4a6355  — secondary text
  --cc-ink-light:  #8aab96  — tertiary / muted labels
  --cc-amber:      #c8935a  — blood-group highlight only
*/

/* ── On-screen preview layout ── */
.cc-preview-row {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.cc-preview-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .65rem;
}
.cc-preview-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── The card face — shared by front and back, screen and print ── */
.cc-card {
  /* Screen size: exactly 85.6 × 54 mm converted to px at 96dpi */
  width: 323px;
  height: 204px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  /* Premium physical depth */
  box-shadow:
    0 1px 2px rgba(44,62,53,.06),
    0 6px 20px rgba(44,62,53,.12),
    0 1px 0 rgba(255,255,255,.8) inset;
}

/* ── FRONT face ── */
.cc-front {
  background: #f7f5f0;
  display: flex;
  flex-direction: column;
  padding: 11px 13px 10px;
  border: 1px solid #d8d4cb;
}

/* Top strip: brand left, type label right */
.cc-front-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid #d8d4cb;
}
.cc-brand {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 800;
  color: #2c3e35;
  letter-spacing: .04em;
}
.cc-brand svg { width: 10px; height: 10px; color: #7a9e87; }
.cc-type-label {
  font-size: 5.5px;
  letter-spacing: .12em;
  color: #8aab96;
  font-weight: 600;
  text-transform: uppercase;
}

/* Middle: name prominent, DOB smaller */
.cc-front-mid {
  margin-bottom: 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.cc-name {
  font-size: 13px;
  font-weight: 800;
  color: #2c3e35;
  letter-spacing: -.01em;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cc-dob {
  font-size: 6.5px;
  color: #8aab96;
  margin-top: 2px;
  letter-spacing: .04em;
  font-weight: 500;
}

/* Bottom: info rows left, QR right */
.cc-front-bottom {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.cc-info-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}
.cc-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  overflow: hidden;
}
.cc-k {
  font-size: 5.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #8aab96;
  min-width: 50px;
  flex-shrink: 0;
}
.cc-v {
  font-size: 7px;
  font-weight: 600;
  color: #2c3e35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Blood group gets amber highlight */
.cc-blood-val {
  font-size: 11px;
  font-weight: 900;
  color: #c8935a;
  letter-spacing: -.01em;
}

/* QR column */
.cc-qr-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}
/* Screen QR size */
#mc-qr canvas, #mc-qr img { width: 54px !important; height: 54px !important; border-radius: 3px; }
.cc-scan-hint {
  font-size: 4.8px;
  color: #8aab96;
  text-align: center;
  letter-spacing: .04em;
  line-height: 1.4;
}

/* Decorative bottom-left arc on the front — echoes the back's ring motif */
.cc-front-arc {
  position: absolute;
  bottom: -36px;
  left: -36px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 1px solid #d0cbc0;
  pointer-events: none;
  opacity: .55;
}
.cc-front-arc::after {
  content: '';
  position: absolute;
  top: 14px; left: 14px;
  right: 14px; bottom: 14px;
  border-radius: 50%;
  border: 1px solid #d0cbc0;
  opacity: .7;
}

/* ── BACK face ── */
.cc-back {
  background: #eef4f0;
  border: 1px solid #c8dccf;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Decorative concentric ring pair — pure CSS, no image */
.cc-back-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid #c8dccf;
  pointer-events: none;
}
.cc-ring-1 { width: 180px; height: 180px; top: -60px; right: -60px; opacity: .5; }
.cc-ring-2 { width: 260px; height: 260px; top: -100px; right: -100px; opacity: .25; }

.cc-back-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 18px;
}
.cc-back-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  color: #2c3e35;
  margin-bottom: 7px;
  letter-spacing: .02em;
}
.cc-back-brand svg { width: 13px; height: 13px; color: #7a9e87; }
.cc-back-tagline {
  font-size: 7.5px;
  color: #4a6355;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 10px;
  letter-spacing: .01em;
}
.cc-back-found {
  font-size: 5.5px;
  color: #8aab96;
  line-height: 1.6;
  letter-spacing: .02em;
}

/* ── Print instructions panel ── */
.cc-print-instructions {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  max-width: 560px;
}
.cc-instructions-header {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: 1rem;
}
.cc-instructions-header svg { width: 18px; height: 18px; color: var(--teal); flex-shrink: 0; }
.cc-instructions-header h3 { font-size: .95rem; font-weight: 700; color: var(--navy); }
.cc-print-instructions ol { padding-left: 1.25rem; margin-bottom: .85rem; }
.cc-print-instructions li { font-size: .86rem; color: var(--muted); margin-bottom: .35rem; line-height: 1.55; }
.cc-print-instructions li strong { color: var(--text); }
.cc-print-instructions .btn svg { width: 16px; height: 16px; }

/* ────────────────────────────────────────────────────────────
   PRINT SHEET — the actual PDF layout
   Hidden on screen.  Shown only during @media print.
   Layout: A4 landscape, two 85.6×54mm panels side by side.
──────────────────────────────────────────────────────────── */
.print-sheet-hidden { display: none; }

/* ── 16. Reports ────────────────────────────────────────────── */
.reports-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1rem;
}
.sort-controls {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .84rem;
  color: var(--muted);
}
.sort-controls label { font-weight: 500; color: var(--muted); }
.sort-controls select { width: auto; padding: .35rem .65rem; font-size: .84rem; }

/* Individual report row */
.report-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: .75rem;
  transition: box-shadow .15s;
}
.report-item:hover { box-shadow: var(--shadow); }

.report-icon-wrap {
  width: 44px; height: 44px;
  background: var(--surface-alt);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.report-icon-wrap svg { width: 20px; height: 20px; color: var(--teal); }

.report-info { flex: 1; min-width: 0; }
.report-type { font-weight: 700; color: var(--navy); font-size: .93rem; }
.report-meta { font-size: .8rem; color: var(--muted); margin-top: .2rem; }
.report-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 4px;
  margin-left: .5rem;
  background: var(--teal-mid);
  color: var(--teal-dark);
  text-transform: uppercase;
  letter-spacing: .04em;
  vertical-align: middle;
}
.report-actions { display: flex; gap: .5rem; flex-shrink: 0; align-items: center; }

/* ── 17. Print styles ───────────────────────────────────────── */
@media print {
  /*
    A4 portrait: 210 × 297 mm.
    Two 85.6 × 54 mm cards stacked vertically fit with plenty of margin.
    Portrait is more natural for a single-sheet fold and easier to set
    correctly in every print dialog.
  */
  @page {
    size: A4 portrait;
    margin: 0;
  }

  /* Hide everything — body direct children including #app-screen */
  body > * { display: none !important; }

  /* Show ONLY the print sheet (it is a direct child of body) */
  #print-sheet { display: block !important; }

  /* Full A4 page, centred content */
  .ps-page {
    width: 210mm;
    height: 297mm;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
  }

  /*
    Cut area: two panels stacked vertically with fold guide between them.
    Total height = 54 + 8mm gap + 54 = 116mm — centred on 297mm page.
    Width = 85.6mm.
  */
  .ps-cut-area {
    display: flex;
    flex-direction: column;   /* ← vertical stack for portrait */
    align-items: center;
    gap: 0;
    position: relative;
    outline: 0.3mm dashed #b0b0b0;
    outline-offset: 3mm;
  }

  /* Each panel: exact credit-card dimensions */
  .ps-panel {
    width:  85.6mm;
    height: 54mm;
    flex-shrink: 0;
  }

  /* Fold guide between the two panels (horizontal bar this time) */
  .ps-fold-guide {
    width:  85.6mm;
    height: 8mm;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }
  .ps-fold-line {
    width:  85.6mm;
    height: 0;
    border-top: 0.3mm dashed #a0a8a2;
    position: absolute;
    top: 50%; left: 0;
    transform: translateY(-50%);
  }
  .ps-fold-label {
    font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
    font-size: 5pt;
    color: #a0a8a2;
    letter-spacing: .12em;
    text-transform: uppercase;
    background: #fff;
    padding: 0 2mm;
    position: relative;
    z-index: 1;
  }

  /*
    For a top-fold card (fold along the horizontal centre line):
    The back panel needs to be rotated 180° so that when you fold
    the top half down over the front, the back reads the correct way up.
  */
  .ps-back { transform: rotate(180deg); }

  /* Card faces at exact physical size */
  .cc-card {
    width:  85.6mm !important;
    height: 54mm   !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  /* Scale all type sizes to physical pt */
  .cc-brand        { font-size: 7pt !important; }
  .cc-brand svg    { width: 8pt !important; height: 8pt !important; }
  .cc-type-label   { font-size: 4.5pt !important; }
  .cc-name         { font-size: 10.5pt !important; }
  .cc-dob          { font-size: 5pt !important; }
  .cc-k            { font-size: 4.5pt !important; min-width: 28pt !important; }
  .cc-v            { font-size: 5.5pt !important; }
  .cc-blood-val    { font-size: 9pt !important; }
  .cc-scan-hint    { font-size: 4pt !important; }
  .cc-back-brand   { font-size: 8.5pt !important; }
  .cc-back-tagline { font-size: 6pt !important; }
  .cc-back-found   { font-size: 4.5pt !important; }

  /* Print QR code size */
  #mc-qr-print canvas,
  #mc-qr-print img {
    width:  48pt !important;
    height: 48pt !important;
    border-radius: 2px !important;
  }

  /* Rings scale down for physical size */
  .cc-ring-1 { width: 130pt !important; height: 130pt !important; top: -44pt !important; right: -44pt !important; }
  .cc-ring-2 { width: 190pt !important; height: 190pt !important; top: -70pt !important; right: -70pt !important; }

  /* Keep the decorative arc on the printed front */
  .cc-front-arc {
    bottom: -28pt !important;
    left:   -28pt !important;
    width:   85pt !important;
    height:  85pt !important;
  }
}

/* ── 18. Responsive / mobile ────────────────────────────────── */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 3rem; }
  .hero-visual { display: none; } /* hide decorative visual on small screens */
  .hero-heading { font-size: 2.1rem; }
  .features-grid { grid-template-columns: 1fr; }
  .hiw-steps { flex-direction: column; gap: 2rem; }
  .hiw-connector { display: none; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-panel-left { display: none; } /* hide on small screens */
  .stat-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  /* Landing nav */
  .lnav-links, .lnav-actions { display: none; }
  .hamburger { display: block; }

  /* App nav */
  .nav-links, .user-email { display: none; }
  .topnav-inner .hamburger { display: block; }

  .form-row { grid-template-columns: 1fr; }
  .section-title { font-size: 1.35rem; }
  .hero-heading  { font-size: 1.75rem; }
  .medical-card  { width: 100%; max-width: 323px; }
  .card-preview-layout { flex-direction: column; }
  .dash-hero { flex-direction: column; align-items: flex-start; }
  .reports-list-header { flex-direction: column; align-items: flex-start; }
}
