/* =========================================================
   Plate My Diet — design system v2 (professional theme)
   ========================================================= */
:root {
  --ink: #0F1A14;
  --ink-2: #26332C;
  --muted: #5B6660;
  --subtle: #8A948E;
  --line: #E5E9E6;
  --line-2: #EEF1EF;
  --ground: #F6F8F7;
  --surface: #FFFFFF;
  --brand: #1F7A4D;
  --brand-600: #18693F;
  --brand-700: #145834;
  --brand-50: #EEF6F1;
  --brand-100: #D7EBDF;
  --turmeric: #F2B21B;
  --turmeric-50: #FFF7E1;
  --turmeric-ink: #6B4500;
  --masala: #B5562B;
  --fruit: #E66A4A;
  --dahi: #7FA6D6;
  --info-50: #EEF4FB;
  --info-ink: #1E3A5F;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 26, 20, .04), 0 1px 1px rgba(15, 26, 20, .03);
  --shadow-md: 0 8px 24px rgba(15, 26, 20, .08);
  --bs-body-font-family: Inter, 'Noto Sans Devanagari', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-font-size: .9375rem;
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: 31, 122, 77;
  --bs-link-hover-color: var(--brand-700);
  --bs-border-color: var(--line);
  --bs-primary: var(--brand);
  --bs-primary-rgb: 31, 122, 77;
}
html { -webkit-text-size-adjust: 100%; }
body { background: var(--ground); color: var(--ink); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
h1, h2, h3, h4, h5, h6, .display-font { font-family: Inter, 'Noto Sans Devanagari', sans-serif; font-weight: 650; letter-spacing: -0.015em; color: var(--ink); }
h1.h2, .page-title { font-size: 1.625rem; font-weight: 700; letter-spacing: -0.02em; }
.h6, h2.h6 { font-weight: 600; font-size: .95rem; letter-spacing: 0; }
a { text-decoration: none; }
.text-muted, .muted { color: var(--muted) !important; }
.small, small { font-size: .8125rem; }
::selection { background: var(--brand-100); }

/* ---------- Buttons & form controls ---------- */
.btn { border-radius: var(--radius-sm); font-weight: 550; min-height: 42px; padding-inline: 1rem; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; transition: background-color .15s, border-color .15s, box-shadow .15s; }
.btn-sm { min-height: 34px; padding-inline: .75rem; font-size: .8125rem; border-radius: 8px; }
.btn-lg { min-height: 50px; padding-inline: 1.4rem; font-size: 1rem; border-radius: 12px; }
.btn-brand { background: var(--brand); color: #fff; border: 1px solid var(--brand); box-shadow: 0 1px 2px rgba(20, 88, 52, .25); }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-brand:active { background: var(--brand-700) !important; color: #fff !important; }
.btn-ink { background: var(--ink); color: #fff; border: 1px solid var(--ink); }
.btn-ink:hover { background: #000; color: #fff; }
.btn-outline-dark { border-color: var(--line); color: var(--ink); background: #fff; }
.btn-outline-dark:hover { background: var(--ground); border-color: #CDD4D0; color: var(--ink); }
.btn-light { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-light:hover { background: var(--ground); border-color: #CDD4D0; }
.btn-group .btn { min-height: 38px; }
.btn-icon { width: 42px; min-width: 42px; padding: 0; }
.btn:focus-visible, .form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 122, 77, .18); outline: 0; }
.form-control, .form-select { min-height: 42px; border-radius: var(--radius-sm); border-color: #D9DFDB; font-size: .9375rem; }
.form-label { font-weight: 550; font-size: .8125rem; color: var(--ink-2); margin-bottom: .35rem; }
.form-text { color: var(--subtle); }
.form-check-input { border-color: #C5CDC8; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
fieldset legend { font-weight: 600; font-size: .9rem; margin-bottom: .6rem; }
.alert { border-radius: var(--radius-sm); border: 1px solid transparent; font-size: .875rem; }
.alert-success { background: var(--brand-50); border-color: var(--brand-100); color: #134a2e; }
.alert-info { background: var(--info-50); border-color: #D6E4F5; color: var(--info-ink); }
.alert-warning { background: var(--turmeric-50); border-color: #F3E2B0; color: var(--turmeric-ink); }
.alert-danger { background: #FDF0EC; border-color: #F6D3C8; color: #7A2410; }
.table { --bs-table-border-color: var(--line-2); }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; border-bottom-color: var(--line); }
.pagination .page-link { color: var(--ink); border-color: var(--line); }
.pagination .active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }
.badge { font-weight: 600; letter-spacing: .01em; }
.modal-content { border: 0; border-radius: 16px; box-shadow: var(--shadow-md); }
.modal-header { border-bottom-color: var(--line-2); }
.dropdown-menu { border-color: var(--line); border-radius: 12px; box-shadow: var(--shadow-md); padding: .35rem; }
.dropdown-item { border-radius: 8px; font-size: .875rem; padding: .5rem .75rem; }
.dropdown-item:active { background: var(--brand); }

/* ---------- Brand mark ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-plate { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); flex-shrink: 0;
  background: conic-gradient(#3E9B5F 0 40%, #F2B21B 40% 65%, #B5562B 65% 90%, #E66A4A 90% 100%); }
.brand small { font-weight: 500; color: var(--subtle); font-size: .7rem; letter-spacing: .02em; }

/* ---------- App shell ---------- */
.topbar { background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--line); min-height: 60px; z-index: 1035; }
.topbar .container-fluid { padding-inline: 1.25rem; }
.app-shell { display: flex; min-height: calc(100vh - 60px); }
.sidebar { width: 248px; background: #fff !important; border-right: 1px solid var(--line); flex-shrink: 0; }
@media (min-width: 992px) { .sidebar { position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; display: flex; flex-direction: column; } }
.sidebar .nav-section { font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--subtle); padding: 1rem .75rem .35rem; }
.sidebar .nav-link { color: var(--ink-2); border-radius: 9px; padding: .55rem .75rem; display: flex; gap: .7rem; align-items: center; font-size: .875rem; font-weight: 500; }
.sidebar .nav-link i { font-size: 1.05rem; color: var(--subtle); width: 18px; text-align: center; }
.sidebar .nav-link:hover { background: var(--ground); color: var(--ink); }
.sidebar .nav-link.active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.sidebar .nav-link.active i { color: var(--brand); }
.sidebar-foot { margin-top: auto; padding: 1rem; border-top: 1px solid var(--line-2); }
.sidebar-note { color: var(--subtle); font-size: .75rem; line-height: 1.45; }
.free-pill { display: inline-flex; align-items: center; gap: .35rem; background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); font-size: .75rem; font-weight: 600; padding: .3rem .6rem; border-radius: 999px; }
.app-main { flex: 1; min-width: 0; padding: 24px 20px 104px; }
@media (min-width: 992px) { .app-main { padding: 32px 40px 56px; } }
.app-main > * { max-width: 1320px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-50); color: var(--brand-700); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; }

/* Mobile bottom nav */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; height: 70px; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; z-index: 1030; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); min-height: 44px; justify-content: center; font-weight: 500; }
.bottom-nav a i { font-size: 20px; }
.bottom-nav a.active { color: var(--brand); font-weight: 600; }
.bottom-nav a.add span { width: 52px; height: 52px; border-radius: 16px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(31,122,77,.30); }
.bottom-nav a.add i { font-size: 22px; }

/* ---------- Cards & stats ---------- */
.card-soft { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
a.card-soft { transition: border-color .15s, box-shadow .15s, transform .15s; }
a.card-soft:hover { border-color: #CDD8D1; box-shadow: var(--shadow-md); }
.card-dark { background: linear-gradient(135deg, #12291C 0%, #0F1A14 100%); color: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-md); }
.card-dark h2 { color: #fff; }
.card-dark .muted-light { color: #B7C7BD; }
.card-dark .btn-outline-light { border-color: rgba(255,255,255,.28); }
.card-tip { background: var(--turmeric-50); border: 1px solid #F3E2B0; border-radius: var(--radius); padding: 16px 18px; color: #4A3000; }
.card-info { background: var(--info-50); border: 1px solid #D6E4F5; border-radius: var(--radius); padding: 14px 16px; color: var(--info-ink); }
.stat-label { font-size: .75rem; color: var(--muted); font-weight: 550; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-weight: 700; font-size: 1.75rem; line-height: 1.15; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.card-head h2 { margin: 0; }

/* ---------- Plate ---------- */
.plate { width: 210px; height: 210px; border-radius: 50%; border: 11px solid #fff; flex-shrink: 0;
  box-shadow: 0 0 0 1px var(--line), 0 12px 28px rgba(15,26,20,.10); display: flex; align-items: center; justify-content: center; }
.plate-center { width: 92px; height: 92px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1px var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; }
.plate-center strong { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em; }
.plate-sm { width: 150px; height: 150px; border-width: 9px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.bar { height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; }

/* ---------- Day strip ---------- */
.day-strip { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 6px; }
.day-strip a { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 8px 0; text-align: center; color: var(--ink); min-height: 44px; font-variant-numeric: tabular-nums; transition: border-color .15s; }
.day-strip a:hover { border-color: #CDD8D1; }
.day-strip a small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 550; }
.day-strip a strong { font-weight: 650; }
.day-strip a.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.day-strip a.active small { color: #B7C7BD; }

/* ---------- Meal cards ---------- */
.meal-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.meal-card.next { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.meal-card.eaten { background: #FBFCFB; }
.meal-card li { padding: 2px 0; }
.badge-soft { font-weight: 600; font-size: 11px; padding: 4px 9px; border-radius: 999px; }
.badge-eaten { background: var(--brand-50); color: var(--brand-700); }
.badge-next { background: var(--turmeric-50); color: var(--turmeric-ink); }
.badge-plan { background: var(--line-2); color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; }

/* Choice chips (radio/checkbox styled) */
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label { border: 1px solid #D9DFDB; background: #fff; border-radius: 10px; padding: 9px 14px; cursor: pointer; display: inline-flex; align-items: center; min-height: 42px; font-size: .875rem; font-weight: 500; transition: border-color .15s, background .15s; }
.choice label:hover { border-color: #B9C4BD; }
.choice input:checked + label { background: var(--brand-50); border-color: var(--brand); color: var(--brand-700); font-weight: 600; box-shadow: inset 0 0 0 1px var(--brand); }
.choice input:focus-visible + label { outline: 3px solid rgba(31,122,77,.35); outline-offset: 2px; }

/* Food search results */
.food-result { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; text-align: left; width: 100%; transition: border-color .15s; }
.food-result:hover { border-color: #B9C4BD; }
.food-result.selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }

/* Planner table */
.planner { min-width: 880px; border-collapse: separate; border-spacing: 6px; }
.planner th { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 4px 8px; }
.planner th a { color: var(--ink); }
.planner td { vertical-align: top; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font-size: 12.5px; line-height: 1.45; }
.planner td.slot { background: transparent; border: 0; font-weight: 600; font-size: 12.5px; color: var(--ink); padding-left: 0; }
.planner td.today { background: var(--brand-50); border-color: var(--brand-100); }

/* ---------- Public site ---------- */
.layout-public { background: #fff; }
.public-nav { position: sticky; top: 0; z-index: 1030; background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--line-2); }
.public-nav a:not(.btn) { color: var(--ink-2); font-weight: 500; }
.public-nav a:not(.btn):hover { color: var(--brand); }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-700); }
.hero { background: radial-gradient(1200px 500px at 80% -10%, #E6F2EA 0%, rgba(230,242,234,0) 60%), #fff; }
.hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.6rem); line-height: 1.05; letter-spacing: -0.035em; font-weight: 750; }
.hero .lead { font-size: 1.125rem; color: var(--muted); line-height: 1.6; }
.hero-shot { background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 30px 60px -20px rgba(15,26,20,.22), 0 0 0 1px rgba(15,26,20,.02); padding: 18px; }
.hero-shot .mini { border: 1px solid var(--line-2); border-radius: 12px; padding: 12px; }
.trust { border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); background: #fff; }
.trust-item { display: flex; align-items: center; gap: .6rem; color: var(--ink-2); font-size: .875rem; font-weight: 500; }
.trust-item i { color: var(--brand); font-size: 1.1rem; }
.section { padding: 88px 0; }
.section-sm { padding: 64px 0; }
.section-title { font-size: clamp(1.7rem, 3vw, 2.25rem); letter-spacing: -0.03em; font-weight: 700; }
.section-lead { color: var(--muted); font-size: 1.05rem; max-width: 620px; }
.feature { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; height: 100%; }
.feature .icon { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-50); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 14px; }
.feature h3 { font-size: 1rem; margin-bottom: .35rem; }
.feature p { color: var(--muted); font-size: .9rem; margin: 0; }
.section-dark { background: var(--ink); color: #fff; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .step { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius); padding: 22px; height: 100%; }
.section-dark .step .n { font-size: .8rem; font-weight: 700; color: var(--turmeric); letter-spacing: .08em; }
.section-dark .step p { color: #B7C7BD; }
.region-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fff; height: 100%; }
.region-card .tag { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-700); }
.free-band { background: linear-gradient(135deg, #145834 0%, #1F7A4D 100%); color: #fff; border-radius: 24px; padding: 48px; }
.free-band h2 { color: #fff; }
.free-band .tick { display: flex; gap: .6rem; align-items: flex-start; color: #E3F1E8; }
.free-band .tick i { color: #9FE0B8; }
.accordion-item { border-color: var(--line); }
.accordion-button { font-weight: 600; font-size: .95rem; }
.accordion-button:not(.collapsed) { background: var(--brand-50); color: var(--brand-700); box-shadow: none; }
.accordion-button:focus { box-shadow: 0 0 0 3px rgba(31,122,77,.18); }
.public-footer { border-top: 1px solid var(--line); color: var(--muted); background: var(--ground); }
.public-footer h4 { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); }
.public-footer a { color: var(--muted); }
.public-footer a:hover { color: var(--brand); }

/* Auth */
.auth-wrap { min-height: calc(100vh - 66px); display: grid; grid-template-columns: 1fr; }
@media (min-width: 992px) { .auth-wrap { grid-template-columns: 1.05fr 1fr; } }
.auth-aside { background: radial-gradient(800px 400px at 0% 0%, #1F7A4D 0%, #0F1A14 70%); color: #fff; padding: 56px; display: none; }
@media (min-width: 992px) { .auth-aside { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-aside h2 { color: #fff; font-size: 2rem; letter-spacing: -0.03em; }
.auth-aside p, .auth-aside li { color: #C8D8CE; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 420px; }

/* Onboarding steps */
.ob-progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ob-progress span { height: 4px; border-radius: 999px; background: var(--line); }
.ob-progress span.on { background: var(--brand); }
.ob-step { display: none; }
.ob-step.active { display: block; }

@media print { .sidebar, .topbar, .bottom-nav, .btn { display: none !important; } .app-main { padding: 0; } }
