/* Care Services — UI styles. --brand comes from config. Fonts are self-hosted (OFL). */
@font-face { font-family: "Inter Var"; src: url("fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Noto Deva Var"; src: url("fonts/noto-sans-devanagari-devanagari-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF; }

@view-transition { navigation: auto; }

:root {
  --brand: #0E5E6F;
  --brand-2: color-mix(in srgb, var(--brand) 70%, #3bb59a);
  --brand-soft: color-mix(in srgb, var(--brand) 9%, #fff);
  --bg: #f3f6f7;
  --card: #ffffff;
  --text: #17262d;
  --muted: #5f6f77;
  --line: #e2e8eb;
  --ok: #2e7d4f;
  --warn: #a86a00;
  --bad: #b3261e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 40, 50, .05), 0 6px 20px -8px rgba(16, 40, 50, .12);
  --shadow-lg: 0 2px 4px rgba(16, 40, 50, .06), 0 18px 40px -12px rgba(16, 40, 50, .22);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 "Inter Var", "Noto Deva Var", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Devanagari", sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-underline-offset: 2px; }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 .3rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .9rem; letter-spacing: -.005em; }
h3 { margin: .9rem 0 .4rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
code { font-size: .82rem; background: #eef2f3; padding: 1px 6px; border-radius: 5px; }
::selection { background: color-mix(in srgb, var(--brand) 25%, #fff); }

/* Top bar */
.topbar { background: linear-gradient(120deg, var(--brand), var(--brand-2)); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 12px -6px rgba(0,0,0,.35); view-transition-name: topbar; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: .6rem 16px; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; }
.logo { color: #fff; font-weight: 750; text-decoration: none; font-size: 1.08rem; display: inline-flex; align-items: center; gap: .55rem; letter-spacing: -.01em; }
.logo-mark { width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.18); position: relative; flex: none; }
.logo-mark::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 2.5px solid #fff; border-right-color: transparent; transform: rotate(-30deg); }
.mainnav { display: flex; flex-wrap: wrap; gap: .2rem; flex: 1; }
.mainnav a { color: rgba(255,255,255,.86); text-decoration: none; padding: .38rem .7rem; border-radius: 8px; transition: background .2s var(--ease), color .2s; }
.mainnav a:hover, .mainnav a.active { background: rgba(255,255,255,.17); color: #fff; }
.me { display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
.me a, .me .linklike { color: #fff; }
.role-tag { background: rgba(255,255,255,.18); padding: 1px 9px; border-radius: 99px; font-size: .76rem; }
.langs { display: flex; gap: 2px; background: rgba(255,255,255,.14); padding: 3px; border-radius: 99px; margin-left: auto; }
.langs a { color: #fff; text-decoration: none; padding: .2rem .7rem; border-radius: 99px; font-size: .85rem; transition: background .2s; }
.langs a.active { background: #fff; color: var(--brand); font-weight: 650; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 1.4rem 16px 2.5rem; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.2rem 1rem 2rem; }

/* Layout */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.narrow { max-width: 560px; }
.stack { display: flex; flex-direction: column; gap: .8rem; }
.stack > .card { margin-bottom: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.grid2 .stack { gap: 1rem; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

/* Forms */
fieldset { margin: 0; min-width: 0; }
legend { font-weight: 700; font-size: 1.05rem; padding: 0; margin-bottom: .9rem; display: flex; align-items: center; gap: .5rem; float: left; width: 100%; }
legend + * { clear: both; }
label { display: flex; flex-direction: column; gap: .32rem; font-size: .88rem; font-weight: 600; color: #2d3f47; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--text); background: #fff; border: 1px solid #cfd8dc; border-radius: 10px;
  padding: .6rem .7rem; width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #aebcc2; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
textarea { resize: vertical; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem 1rem; }
.fields .full { grid-column: 1 / -1; }
label.check { flex-direction: row; align-items: flex-start; font-weight: 400; gap: .6rem; }
label.check input { width: 1.15rem; height: 1.15rem; margin-top: .15rem; accent-color: var(--brand); flex: none; }
.consent { background: var(--brand-soft); padding: .9rem; border-radius: 10px; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.lock { font-size: .8rem; }
.code-input { letter-spacing: .4em; font-size: 1.2rem; text-align: center; font-weight: 650; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; background: var(--brand); color: #fff; border: 1px solid var(--brand);
  border-radius: 10px; padding: .58rem 1.05rem; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), filter .2s, background .2s;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 4px 12px -6px color-mix(in srgb, var(--brand) 60%, transparent);
}
.btn:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 10px 20px -10px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: 2px; }
.btn-ghost { background: transparent; color: var(--brand); box-shadow: none; }
.btn-ghost:hover { background: var(--brand-soft); box-shadow: none; }
.btn-block { width: 100%; }
.btn-lg { padding: .85rem 1.2rem; font-size: 1.05rem; }
.btn[disabled] { opacity: .7; cursor: default; transform: none; }
.btn.is-loading::after { content: ""; width: 1em; height: 1em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }
.danger { color: var(--bad); }
form.inline { display: inline; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filters input, .filters select { width: auto; flex: 1 1 160px; }

/* Flash */
.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid; animation: drop .35s var(--ease) both; }
.flash ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.flash-success { background: #e9f6ee; border-color: #bfe3cb; color: #1d5a36; }
.flash-error { background: #fdeeec; border-color: #f3c3be; color: #8a1c15; }
.flash-warn { background: #fff6e2; border-color: #f0d59d; color: #6d4700; }
.flash-info { background: #eaf3fb; border-color: #bfd8f0; color: #1d4a75; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .6rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #f7fafb; }
tr.dim td { opacity: .55; }
.due { color: var(--bad); font-weight: 650; }

/* Badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .76rem; font-weight: 650; background: #eef2f3; color: #34444c; white-space: nowrap; }
.stage-screening, .stage-documents { background: #e9f2fb; color: #1d4a75; }
.stage-medical, .stage-attorney { background: #f1ecfb; color: #4b2d83; }
.stage-filed, .stage-hearing { background: #fff5e0; color: #6d4700; }
.stage-settled, .stage-paid { background: #e8f5ec; color: #1d5a36; }
.status-on_hold { background: #fff5e0; color: #6d4700; }
.status-closed_won { background: #e8f5ec; color: #1d5a36; }
.status-closed_lost { background: #fdecea; color: #8a1c15; }
.elig-eligible, .elig-likely { background: #e8f5ec; color: #1d5a36; }
.elig-not_eligible, .elig-unlikely { background: #fdecea; color: #8a1c15; }
.tag { background: #e9f2fb; color: #1d4a75; padding: 0 6px; border-radius: 4px; }

/* Dashboard */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.stat-n { font-size: 1.9rem; font-weight: 750; color: var(--brand); line-height: 1.1; letter-spacing: -.02em; }
.stat-l { color: var(--muted); font-size: .85rem; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.pipeline { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: .6rem; }
.pipe { border: 1px solid var(--line); border-radius: 10px; padding: .75rem; text-decoration: none; color: var(--text); display: flex; flex-direction: column; transition: border-color .2s, transform .2s var(--ease), box-shadow .2s; }
.pipe:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
.pipe-n { font-size: 1.45rem; font-weight: 750; }
.pipe-l { font-size: .8rem; color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }

/* Case view */
.progress { list-style: none; display: flex; padding: 0; margin: 0 0 1rem; overflow-x: auto; gap: 4px; }
.progress li { flex: 1 0 auto; min-width: 92px; padding: .48rem .5rem; background: #e5ebed; font-size: .75rem; text-align: center; color: var(--muted); border-radius: 8px; }
.progress li.done { background: color-mix(in srgb, var(--brand) 20%, #fff); color: var(--text); }
.progress li.now { background: var(--brand); color: #fff; font-weight: 700; box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--brand) 70%, transparent); }
.kv { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv strong { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.kv.block { flex-direction: column; gap: .25rem; }
.pre { background: #f6f9fa; border-radius: 8px; padding: .65rem; overflow-wrap: anywhere; }
.upload { display: flex; flex-wrap: wrap; gap: .5rem; }
.upload select, .upload input { flex: 1 1 180px; width: auto; }
.notes { list-style: none; padding: 0; margin: 1rem 0 0; }
.notes li { border-left: 3px solid var(--line); padding: .45rem .8rem; margin-bottom: .75rem; overflow-wrap: anywhere; border-radius: 0 8px 8px 0; }
.notes li.shared { border-left-color: var(--brand); background: var(--brand-soft); }
.notes li.from-client { border-left-color: #a86a00; background: #fffaf0; }
.notes li.mine { border-left-color: #a86a00; background: #fffaf0; margin-left: 1.5rem; }
.pager { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: 1rem; }
.pager a { padding: .32rem .7rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; background: #fff; }
.pager a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.orig { display: block; font-weight: 400; font-size: .82rem; color: #6d4700; background: #fff8e8; border-radius: 6px; padding: .3rem .5rem; margin-top: .25rem; overflow-wrap: anywhere; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
details summary { cursor: pointer; margin: .6rem 0; color: var(--brand); }

/* Login */
.login-box { max-width: 400px; margin: 8vh auto 0; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 2rem 1.6rem; display: flex; flex-direction: column; gap: .8rem; box-shadow: var(--shadow-lg); }
.login-box form { display: flex; flex-direction: column; gap: .85rem; }
.login-brand { font-size: 1.55rem; font-weight: 800; color: var(--brand); letter-spacing: -.02em; }
.login-box p { margin: -.4rem 0 .3rem; }

/* Client portal */
.portal-wrap { max-width: 760px; }
.status-now { background: linear-gradient(135deg, var(--brand-soft), #fff); border: 1px solid color-mix(in srgb, var(--brand) 15%, #fff); border-radius: 12px; padding: 1rem 1.1rem; margin: .9rem 0; }
.status-name { font-size: 1.35rem; font-weight: 750; color: var(--brand); letter-spacing: -.01em; }
.status-now p { margin: .3rem 0 0; }
.meter { height: 8px; background: #e3eaec; border-radius: 99px; overflow: hidden; margin-top: .8rem; }
.meter span { display: block; height: 100%; width: var(--p, 0%); background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: inherit; transition: width .6s var(--ease); animation: grow .9s var(--ease) both; }
.vtimeline { list-style: none; padding: 0; margin: .6rem 0; }
.vtimeline li { position: relative; padding: .32rem 0 .32rem 1.7rem; color: var(--muted); }
.vtimeline li::before { content: ""; position: absolute; left: .35rem; top: .72rem; width: .7rem; height: .7rem; border-radius: 50%; border: 2px solid #c5cfd4; background: #fff; transition: all .3s; z-index: 1; }
.vtimeline li:not(:last-child)::after { content: ""; position: absolute; left: .67rem; top: 1.45rem; bottom: -.32rem; width: 2px; background: #e1e7ea; }
.vtimeline li.done { color: var(--text); }
.vtimeline li.done::before { background: var(--brand); border-color: var(--brand); }
.vtimeline li.done::after { background: var(--brand); }
.vtimeline li.now { color: var(--brand); font-weight: 700; }
.vtimeline li.now::before { background: #fff; border-color: var(--brand); animation: pulse 2s ease-out infinite; }
.req { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.req > div { flex: 1 1 100%; }
.req input[type=file] { flex: 1 1 200px; width: auto; }
.portal-card-code { font-size: 1.6rem; font-weight: 800; letter-spacing: .2em; color: var(--brand); }

/* Multi-step form */
.hero-card { background: linear-gradient(135deg, #fff 40%, var(--brand-soft)); }
.wizard-head { position: sticky; top: 54px; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); padding: .6rem 0 .4rem; }
.wizard-dots { list-style: none; display: flex; gap: .4rem; padding: 0; margin: .3rem 0 .5rem; }
.wizard-dots li { flex: 1; display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: var(--muted); min-width: 0; }
.wizard-dots li span { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; background: #e3eaec; font-weight: 700; flex: none; transition: all .3s var(--ease); }
.wizard-dots li em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wizard-dots li.done span { background: var(--brand); color: #fff; }
.wizard-dots li.now span { background: #fff; color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.wizard-dots li.now { color: var(--text); font-weight: 650; }
@media (max-width: 600px) { .wizard-dots li em { display: none; } .wizard-dots li.now em { display: inline; } }
.is-wizard .step { view-transition-name: wizard-step; }
.step-no { width: 1.7rem; height: 1.7rem; display: inline-grid; place-items: center; border-radius: 50%; background: var(--brand); color: #fff; font-size: .85rem; }
.step-nav { display: flex; justify-content: space-between; gap: .5rem; margin-top: 1.2rem; }
.step-nav .btn:only-child { margin-left: auto; }

/* Thank-you */
.done-card { text-align: center; }
.done-card .kv { text-align: left; }
.check-anim svg { width: 72px; height: 72px; }
.check-anim circle { fill: none; stroke: var(--brand); stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .6s var(--ease) forwards; }
.check-anim path { fill: none; stroke: var(--brand); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .4s .5s var(--ease) forwards; }

/* Motion */
.rise { animation: rise .55s var(--ease) both; }
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s var(--ease) var(--d, 0ms), transform .5s var(--ease) var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { width: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 45%, transparent); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
::view-transition-old(wizard-step) { animation: .22s var(--ease) both fade-out-left; }
::view-transition-new(wizard-step) { animation: .32s var(--ease) both fade-in-right; }
@keyframes fade-out-left { to { opacity: 0; transform: translateX(-24px); } }
@keyframes fade-in-right { from { opacity: 0; transform: translateX(24px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}
@media print { .topbar, .foot, .btn { display: none !important; } .card { box-shadow: none; } }
