/* frontend/assets/css/styles.css */
:root {
  --primary: #1C1917;
  --primary-dark: #0C0A09;
  --primary-light: #F5F5F4;
  --primary-soft: #F5F5F4;
  --bg: #FAFAF9;
  --surface: #FFFFFF;
  --text: #1C1917;
  --text-muted: #57534E;
  --border: #E7E5E4;
  --border-strong: #D6D3D1;
  --danger: #B42318;
  --danger-soft: #FEF3F2;
  --warn: #7A4A00;
  --warn-soft: #FEF0C7;
  --success: #166534;
  --success-soft: #F5F5F4;
  --accent: #0F766E;
  --accent-soft: #F0F7F5;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Telugu",
    "Noto Sans Devanagari", "Noto Sans Tamil", "Noto Sans Kannada", "Noto Sans Bengali",
    "Noto Sans Arabic", sans-serif;
}

.container.landing-main { max-width: 1000px; padding-top: 56px; padding-bottom: 48px; }
.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: clamp(32px, 6vw, 72px);
  padding: 18px 0 52px;
}
.landing-copy { max-width: 540px; }
.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.035em;
}
.landing-copy h1, .about-intro h1 {
  max-width: 620px;
  font-size: clamp(2.1rem, 5vw, 3.35rem);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.035em;
}
.landing-lede {
  max-width: 540px;
  color: var(--text-muted);
  font-size: 1.08rem;
  line-height: 1.65;
}
.landing-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 8px; }
.landing-disclaimer { max-width: 520px; color: var(--text-muted); font-size: 0.82rem; }
.sample-sheet {
  padding: 24px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
}
.sample-sheet-header { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.sample-sheet-header [data-lucide] { width: 22px; height: 22px; color: var(--accent); }
.sample-sheet-title { font-size: 1rem; font-weight: 650; }
.sample-sheet-subtitle { margin-top: 2px; color: var(--text-muted); font-size: 0.78rem; }
.sample-sheet-row { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 17px 0; border-bottom: 1px solid var(--border); }
.sample-sheet-row:last-of-type { border-bottom: 0; }
.sample-number { color: var(--accent); font-size: 0.75rem; font-variant-numeric: tabular-nums; padding-top: 2px; }
.sample-sheet-row strong { font-size: 0.88rem; font-weight: 600; }
.sample-sheet-row p { margin-top: 3px; color: var(--text-muted); font-size: 0.82rem; line-height: 1.5; }
.sample-sheet-footnote { margin-top: 4px; padding-top: 13px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.74rem; }
.landing-details { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong); }
.landing-detail { padding: 24px 20px; }
.landing-detail:first-child { padding-left: 0; }
.landing-detail + .landing-detail { border-left: 1px solid var(--border); }
.landing-detail [data-lucide] { width: 20px; height: 20px; color: var(--accent); }
.landing-detail h2 { margin-top: 14px; font-size: 0.96rem; font-weight: 600; }
.landing-detail p { margin-top: 6px; color: var(--text-muted); font-size: 0.84rem; line-height: 1.55; }
.upload-limits { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px 24px; padding: 25px 0; }
.upload-limits h2 { font-size: 0.95rem; font-weight: 600; }
.upload-limits p { color: var(--text-muted); font-size: 0.82rem; }
.upload-limits .upload-limits-value { color: var(--text); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.text-link { color: var(--accent); font-size: 0.84rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.site-footer > .container { display: flex; justify-content: space-between; gap: 20px; padding-top: 18px; padding-bottom: 18px; color: var(--text-muted); font-size: 0.78rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.container-narrow.about-main { display: grid; gap: 16px; max-width: 760px; padding-top: 48px; padding-bottom: 48px; }
.about-intro { padding-bottom: 12px; }
.about-intro h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
.about-intro > p:last-child { max-width: 680px; color: var(--text-muted); font-size: 1rem; line-height: 1.65; }
.about-main h2 { font-size: 1.08rem; font-weight: 600; }
.about-main .card > p, .plain-list, .process-list { color: var(--text-muted); font-size: 0.88rem; line-height: 1.65; }
.process-list, .plain-list { padding-left: 20px; }
.process-list li + li, .plain-list li + li { margin-top: 9px; }
.process-list strong { color: var(--text); font-weight: 600; }
.notice { padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--text); font-size: 0.84rem; line-height: 1.55; }
.notice-warn { border-left-color: var(--warn); background: var(--warn-soft); }
.about-action { padding-top: 4px; }
.container-narrow.contact-main { max-width: 650px; padding-top: 72px; padding-bottom: 96px; }
.contact-notice { padding: 28px; }
.contact-notice h1 { font-size: clamp(1.7rem, 4vw, 2.25rem); font-weight: 650; line-height: 1.15; letter-spacing: -0.025em; }
.contact-notice > p { color: var(--text-muted); font-size: 0.92rem; line-height: 1.6; }
.consent-panel { padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: #F8F8F6; }
.consent-panel label { font-size: 0.82rem !important; line-height: 1.5; }
.quiet-note { color: var(--text-muted); font-size: 0.78rem; line-height: 1.5; }
.critical-notice { border-color: #FECACA; background: var(--danger-soft); }
.sample-sheet, .landing-detail, .about-main .card, .contact-notice { box-shadow: none; }

@media (max-width: 768px) {
  .container.landing-main { padding-top: 32px; }
  .landing-hero { grid-template-columns: 1fr; gap: 28px; padding: 8px 0 34px; }
  .landing-copy h1 { font-size: clamp(2rem, 9vw, 2.8rem); }
  .sample-sheet { padding: 18px; }
  .landing-details { grid-template-columns: 1fr; }
  .landing-detail, .landing-detail:first-child { padding: 18px 0; }
  .landing-detail + .landing-detail { border-left: 0; border-top: 1px solid var(--border); }
  .landing-detail h2 { margin-top: 8px; }
  .upload-limits { grid-template-columns: 1fr; gap: 8px; }
  .site-footer > .container { flex-direction: column; }
  .container-narrow.about-main { padding-top: 32px; }
  .container-narrow.contact-main { padding-top: 36px; }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-size: 1.0625rem;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}

a { text-decoration: none; color: inherit; }
button, select, input, textarea { font-family: inherit; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid #1C1917; outline-offset: 2px; }

/* MINIMALIST CENTERED CONTAINER */
.container, .container-narrow {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px;
}

/* CLEAN HEADER */
.top-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  gap: 12px;
}
.brand-link { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.05rem; color: var(--text); }
.brand-link[type="button"] { border: 0; padding: 0; background: transparent; cursor: pointer; }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; }
.brand-accent { color: var(--accent); }
.brand-link [data-lucide] { width: 23px; height: 23px; color: var(--accent); }

.desktop-nav { display: flex; align-items: center; gap: 20px; font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }
.desktop-nav a:hover, .desktop-nav a.active { color: var(--text); font-weight: 600; }

/* MOBILE BOTTOM BAR */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 45;
  background: #FFFFFF;
  border-top: 1px solid var(--border);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.mobile-nav-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.mobile-nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 6px 4px; border-radius: 10px; font-size: 0.68rem; font-weight: 600;
  color: var(--text-muted); background: transparent; border: none; cursor: pointer;
}
.mobile-nav-item.active { color: var(--primary-dark); background: var(--primary-soft); }

/* MINIMAL BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 600; font-size: 1rem; min-height: 48px; padding: 10px 18px; border-radius: 12px;
  border: 1px solid transparent; cursor: pointer; transition: 0.15s ease;
}
.btn-primary { background: var(--primary); color: #FFFFFF; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #FFFFFF; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: #F9FAFB; }
.btn-soft { background: var(--primary-soft); color: var(--primary-dark); }
.btn-lg { min-height: 60px; font-size: 1.15rem; font-weight: 700; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-icon {
  width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border);
  background: #FFFFFF; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.btn-icon:hover { color: var(--primary); border-color: var(--primary); }

/* MINIMAL CARDS & GRIDS */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.space-y > * + * { margin-top: 14px; }

/* FAMILY STRIP */
.sub-bar { background: #FFFFFF; border-bottom: 1px solid var(--border); padding: 8px 0; }
.pills-scroll { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.pills-scroll::-webkit-scrollbar { display: none; }
.family-pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 16px;
  border-radius: 999px; font-size: 0.9rem; font-weight: 600;
  background: #F3F4F6; color: #374151; border: none; cursor: pointer; white-space: nowrap;
}
.family-pill.active { background: var(--text); color: #FFFFFF; }
.pill-count { font-size: 0.65rem; opacity: 0.75; }

/* SEGMENTED TABS */
.segmented-control { display: inline-flex; background: #F3F4F6; padding: 3px; border-radius: 10px; }
.seg-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px;
  border-radius: 8px; font-size: 0.76rem; font-weight: 600;
  color: var(--text-muted); background: transparent; border: none; cursor: pointer;
}
.seg-btn.active { background: #FFFFFF; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }

/* DROPZONE */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1.5px dashed #CBD5E1; background: #FAFAFA; border-radius: 12px;
  padding: 24px 16px; text-align: center; cursor: pointer; transition: 0.15s ease;
}
.dropzone:hover { border-color: var(--primary); background: var(--primary-soft); }

/* SUBTLE BADGES & COMPARISON */
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem;
  font-weight: 600; padding: 3px 8px; border-radius: 6px;
}
.badge-teal { background: var(--primary-soft); color: var(--primary-dark); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }

.compare-box {
  display: flex; align-items: center; justify-content: space-between;
  background: #F9FAFB; border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 0.8rem;
}
.compare-label { font-size: 0.68rem; color: var(--text-muted); }
.compare-val-alert { font-weight: 700; color: var(--danger); }
.compare-val-healthy { font-weight: 600; color: var(--success); }

.input-field {
  width: 100%; min-height: 44px; border: 1px solid var(--border); background: #FFFFFF;
  border-radius: 10px; padding: 9px 12px; font-size: 1rem; outline: none;
}
.input-field:focus { border-color: var(--primary); }

.audio-bar {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 50; background: #111827; color: #FFFFFF; padding: 10px 14px;
  border-radius: 12px; width: 92%; max-width: 480px; display: flex; align-items: center; gap: 10px;
}
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.4);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-sheet { background: #FFFFFF; border-radius: 16px; max-width: 400px; width: 100%; padding: 20px; }

/* Sign-in and install experience */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
  background: var(--bg);
}
.login-layout {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 480px;
  padding-top: 28px;
  padding-bottom: 36px;
}
.login-card { width: 100%; padding: 24px; }
.login-intro h1 {
  margin-top: 10px;
  font-size: clamp(1.55rem, 5vw, 2rem);
  line-height: 1.18;
  letter-spacing: -0.035em;
}
.login-signin { text-align: center; }
.login-signin h2 { font-size: 0.98rem; font-weight: 700; }
.login-signin p { margin-top: 3px; color: var(--text-muted); font-size: 0.76rem; }
.login-privacy {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #F9FAFB;
}
.login-privacy p {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #475569;
  font-size: 0.72rem;
  line-height: 1.45;
}
.login-privacy svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; }
.pwa-install-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #DCE5EB;
  border-radius: 12px;
  background: #F1F5F9;
}
.pwa-install-card[hidden] { display: none; }
.install-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.install-icon { font-size: 1.4rem; }
.install-title { color: #0F172A; font-size: 0.82rem; font-weight: 700; }
.install-sub { margin-top: 2px; color: #64748B; font-size: 0.7rem; line-height: 1.35; }
.btn-install {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: #111827;
  color: #FFFFFF;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn-install:hover { background: #273449; }
.btn-install:disabled { cursor: wait; opacity: 0.65; }

/* Mobile-first workspace with a centered desktop canvas */
.dashboard-page { min-height: 100vh; }
.dashboard-page main.container { max-width: 900px; padding-top: 18px !important; }
.dashboard-page .mobile-bottom-nav {
  left: 50%;
  right: auto;
  width: calc(100% - 24px);
  max-width: 540px;
  transform: translateX(-50%);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
}

@media (max-width: 768px) {
  .desktop-nav, .desktop-only { display: none !important; }
  .dashboard-page .mobile-bottom-nav { display: block; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .audio-bar { bottom: 72px; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-sheet { border-radius: 16px 16px 0 0; max-width: 100%; }
  .login-layout { align-items: flex-start; padding-top: 24px; padding-bottom: 24px; }
  .login-card { padding: 20px; }
  .dashboard-page .header-inner { min-height: 58px; height: auto; padding-top: 8px; padding-bottom: 8px; }
  .dashboard-page .header-inner > div:last-child { gap: 5px !important; }
  .dashboard-page #languageSelect { max-width: 148px; padding: 6px 7px !important; }
  .dashboard-page #householdSwitcher { max-width: 112px !important; }
  .dashboard-page .sub-bar { padding: 7px 0; }
  .dashboard-page main.container { padding-right: 12px; padding-left: 12px; padding-bottom: 12px; }
  .dashboard-page .card { padding: 15px; }
}

@media (min-width: 769px) {
  .dashboard-page {
    background: #F3F4F6;
  }
  .dashboard-page .top-header { background: rgba(255, 255, 255, 0.96); }
  .dashboard-page main.container { padding-top: 24px !important; padding-bottom: 32px; }
  .dashboard-page .mobile-bottom-nav { display: none; }
}

@media (max-width: 380px) {
  .pwa-install-card { align-items: flex-start; flex-direction: column; }
  .btn-install { width: 100%; }
  .dashboard-page .brand-link { font-size: 0.92rem; }
  .dashboard-page #languageSelect { max-width: 118px; font-size: 0.7rem !important; }
}