/* Excel Health Plans — IMQ. Brand: Excel orange #FA6414 + black, Montserrat (matches the Excel logo). */
@font-face { font-family: Montserrat; src: url(/static/fonts/Montserrat-Variable.ttf) format('truetype'); font-weight: 100 900; font-display: swap; }

:root {
  /* --navy = dark surfaces & headings, --blue = accent used for text/links (dark orange for contrast) */
  --orange: #fa6414; --orange-hover: #e5560c; --navy: #141414; --blue: #b84808; --bright: #fa6414; --sky: #ffb07f;
  --tint: #fff4ec; --line: #e6e1dc; --ink: #1c1c1c; --grey: #5f5a55;
  --ok: #18794e; --ok-bg: #e7f6ee; --flag: #b42318; --flag-bg: #fdecea; --warn: #a15c00; --warn-bg: #fff4e5;
  --radius: 12px; --shadow: 0 1px 2px rgba(15,34,56,.06), 0 4px 16px rgba(15,34,56,.06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 Montserrat, system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--ink); background: #faf8f6; }
a { color: var(--blue); }
h1, h2, h3 { color: var(--navy); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; margin-top: 1.2em; }
.muted { color: var(--grey); } .hint { color: var(--grey); font-size: .8rem; margin: .25rem 0 0; display: block; }
.small { font-size: .8rem; } .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } .nowrap { white-space: nowrap; }
.center { text-align: center; } .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* brand */
.brand { font-weight: 700; letter-spacing: -.01em; font-size: 1.35rem; white-space: nowrap; }
.brand .b1 { color: var(--navy); } .brand .b2 { color: var(--blue); } .brand .b3 { font-weight: 400; font-size: .58em; color: var(--grey); letter-spacing: .12em; }
.hero .brand .b1 { color: #fff; } .hero .brand .b2 { color: var(--sky); } .hero .brand .b3 { color: #c9dcf0; }

img.logo { height: 40px; width: auto; display: block; }
.admin-brand img.logo, .auth-brand img.logo { height: 32px; }
/* public hero */
.hero { background: var(--navy); color: #fff; position: relative; overflow: hidden; }
.hero::before, .hero::after { content: ''; position: absolute; border-radius: 50%; }
.hero::before { width: 340px; height: 340px; background: var(--blue); right: -110px; top: -160px; }
.hero::after { width: 150px; height: 150px; background: var(--bright); right: -50px; top: 80px; }
.hero-in { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; padding: 28px 20px 30px; }
.hero h1 { color: #fff; font-size: clamp(1.5rem, 4vw, 2.1rem); margin: .6rem 0 .2rem; }
.hero .tagline { margin: .1rem 0 0; font-style: italic; font-size: .8rem; color: #afc6de; }
.hero .sub { margin: 0; color: #c9dcf0; font-size: .9rem; }
.hero.small .hero-in { padding: 18px 20px; }

.wrap { max-width: 880px; margin: 0 auto; padding: 20px 16px 40px; }
.wrap.narrow { max-width: 560px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.intro { border-left: 4px solid var(--blue); font-size: .92rem; }
.intro p { margin: 0; }

/* progress */
.progress { list-style: none; display: flex; gap: 6px; padding: 0; margin: 4px 0 16px; counter-reset: s; }
.progress li { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: .72rem; color: var(--grey); }
.progress li::before { content: ''; height: 5px; border-radius: 4px; background: var(--line); }
.progress li span { display: none; }
.progress li.done::before, .progress li.on::before { background: var(--blue); }
.progress li.on { color: var(--navy); font-weight: 500; }
.progress li em { font-style: normal; }
@media (max-width: 640px) { .progress li em { display: none; } .progress li.on em { display: block; } }

/* steps */
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 22px 18px; margin-bottom: 18px; }
.js .step { display: none; } .js .step.on { display: block; }
.step-h { display: flex; align-items: center; gap: 10px; border-bottom: 2px solid var(--blue); padding-bottom: 10px; margin-bottom: 16px; }
.step-h .num { background: var(--blue); color: #fff; width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.step-h h2 { margin: 0; font-size: 1.25rem; }
.blk { margin-bottom: 6px; }
.subhead { font-size: .95rem; margin: 1rem 0 .6rem; }
.spacer { height: 10px; }

/* grid */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 14px; }
.grid > .c, .grid > .fld, .grid > .check, .grid > div { grid-column: span 12; }
@media (min-width: 700px) {
  .span-1 { grid-column: span 1 !important; } .span-2 { grid-column: span 2 !important; } .span-3 { grid-column: span 3 !important; }
  .span-4 { grid-column: span 4 !important; } .span-5 { grid-column: span 5 !important; } .span-6 { grid-column: span 6 !important; }
  .span-8 { grid-column: span 8 !important; } .span-9 { grid-column: span 9 !important; } .span-12 { grid-column: span 12 !important; }
  .g-dep .c-last, .g-dep .c-first { grid-column: span 6; } .g-dep .c-social, .g-dep .c-date { grid-column: span 4; } .g-dep .c-sex, .g-dep .c-tobacco { grid-column: span 2; }
  .g-det .c-c1 { grid-column: span 3; } .g-det .c-c2 { grid-column: span 9; } .g-det .c-c3 { grid-column: span 12; }
  .g-det .c-c4, .g-det .c-c5 { grid-column: span 3; } .g-det .c-c6 { grid-column: span 6; }
  .g-auth .c-n { grid-column: span 8; } .g-auth .c-d { grid-column: span 4; }
}
@media (min-width: 380px) and (max-width: 699px) { .span-1, .span-2, .span-3 { grid-column: span 6 !important; } }

/* fields */
.fld { display: block; margin-bottom: 12px; }
.lbl { display: block; font-size: .72rem; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--grey); margin-bottom: 4px; }
.req { color: var(--flag); font-style: normal; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=password], input[type=search], input:not([type]), select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fbfdff; border: 1px solid #c3d1e0; border-radius: 8px; padding: 10px 12px; min-height: 44px;
  transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--bright); box-shadow: 0 0 0 3px rgba(28,118,194,.18); background: #fff; }
[aria-invalid=true], .has-err input { border-color: var(--flag) !important; }
.err { color: var(--flag); font-size: .8rem; margin: .25rem 0 0; font-weight: 500; }

/* choices */
.choice { border: 0; padding: 0; margin: 4px 0 14px; }
.choice legend { font-weight: 500; font-size: .92rem; margin-bottom: 6px; padding: 0; color: var(--ink); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pill span { display: inline-block; border: 1px solid #c3d1e0; border-radius: 999px; padding: 8px 16px; font-size: .9rem; background: #fff; cursor: pointer; min-height: 40px; }
.pill input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.pill input:focus-visible + span { box-shadow: 0 0 0 3px rgba(28,118,194,.3); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: .9rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--blue); flex: none; }

/* yes/no health rows */
.yn { border: 0; margin: 0; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center; border-radius: 8px; }
.blk-yn:nth-of-type(odd) .yn { background: var(--tint); }
.yn-q { display: flex; gap: 8px; font-size: .9rem; } .yn-q b { color: var(--blue); min-width: 1.4em; }
.yn-a { display: flex; gap: 6px; }
.yn-opt { position: relative; }
.yn-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.yn-opt span { display: inline-block; min-width: 58px; text-align: center; border: 1px solid #c3d1e0; border-radius: 8px; padding: 7px 10px; background: #fff; font-weight: 500; font-size: .85rem; cursor: pointer; }
.yn-yes input:checked + span { background: var(--flag); border-color: var(--flag); color: #fff; }
.yn-no input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.yn-opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(28,118,194,.3); }
.yn .err { grid-column: 1 / -1; }
.yn.has-err { outline: 2px solid var(--flag); }
@media (max-width: 560px) { .yn { grid-template-columns: 1fr; } .yn-a { padding-left: 1.9em; } }

/* repeating cards */
.reps .card { box-shadow: none; padding: 14px 16px 4px; background: #fbfdff; }
.card-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card-h b { color: var(--navy); }

/* notices & legal */
.notice { background: var(--tint); border-left: 3px solid var(--blue); padding: 12px 14px; border-radius: 0 8px 8px 0; font-size: .88rem; margin: 6px 0 14px; }
.notice.muted { color: var(--grey); font-size: .8rem; }
.notice.warn { background: var(--warn-bg); border-color: #c77700; color: #5f3b00; }
.legal { font-size: .8rem; color: var(--grey); max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 14px; background: #fbfdff; }
.acks { font-size: .82rem; padding-left: 1.1rem; color: #36414e; } .acks li { margin-bottom: 6px; }
.sign { border: 2px solid var(--blue); background: var(--tint); box-shadow: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 500; background: var(--blue); color: #fff; border: 1px solid var(--blue); border-radius: 8px; padding: 10px 20px; min-height: 44px; cursor: pointer; text-decoration: none; }
.btn:hover { background: #00427c; }
.btn.ghost { background: #fff; color: var(--blue); } .btn.ghost:hover { background: var(--tint); }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: .85rem; }
.btn.wide { width: 100%; }
.btn.danger { background: var(--flag); border-color: var(--flag); }
.link { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; font-size: .85rem; cursor: pointer; text-decoration: underline; }
.link.danger { color: var(--flag); }
.nav { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 18px; }
.js .nav .submit { display: none; } .js .step.last .nav .submit { display: inline-flex; } .js .step.last .nav .next { display: none; }
.js .step.first .nav .prev { visibility: hidden; }
.nav { flex-wrap: wrap; } .no-js .nav .prev, .no-js .nav .next { display: none; }

.errbox { background: var(--flag-bg); color: var(--flag); border: 1px solid #f5c2bd; border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.done .tick { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); font-size: 2rem; display: grid; place-items: center; margin: 0 auto 12px; }
.ref { font-family: ui-monospace, Menlo, monospace; font-size: 1.6rem; font-weight: 700; color: var(--navy); letter-spacing: .06em; margin: 0 0 8px; }
.site-foot { max-width: 880px; margin: 0 auto; padding: 0 16px 30px; display: flex; flex-direction: column; gap: 2px; font-size: .75rem; color: var(--grey); }

/* ------------------------------------------------ admin */
body.admin { background: #faf8f6; font-size: 14px; }
.admin-bar { background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 24px; padding: 10px 24px; flex-wrap: wrap; }
.admin-brand { text-decoration: none; display: flex; align-items: center; gap: 10px; } .admin-brand .brand { font-size: 1.15rem; }
.tag { font-size: .68rem; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; background: var(--tint); color: var(--blue); border-radius: 6px; padding: 3px 8px; }
.admin-bar nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.admin-bar nav a { text-decoration: none; color: var(--grey); padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.admin-bar nav a.on, .admin-bar nav a:hover { background: var(--tint); color: var(--navy); }
.admin-bar nav a.ext { margin-left: auto; color: var(--blue); }
.who { display: flex; align-items: center; gap: 12px; font-size: .85rem; }
.who a { font-weight: 500; text-decoration: none; color: var(--navy); } .who .role { color: var(--grey); font-size: .75rem; }
.who form { margin: 0; }
.admin-main { max-width: 1240px; margin: 0 auto; padding: 24px; }
.page-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 16px; flex-wrap: wrap; }
.page-h > div:first-child { flex: 1; min-width: 280px; } .page-h h1 { margin-bottom: 2px; } .page-h p { margin: 0; max-width: 720px; }
.linkbox { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 320px; }
.copyrow { display: flex; gap: 6px; } .copyrow input { min-height: 34px; padding: 6px 10px; font-size: .85rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; } .actions form { margin: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters select, .filters input { width: auto; min-height: 36px; padding: 6px 10px; font-size: .88rem; }
.filters input[type=search] { min-width: 260px; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: #fff; background: var(--navy); padding: 10px 12px; font-weight: 500; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:nth-child(even) td { background: #fafcfe; }
.tbl tr.rowlink { cursor: pointer; } .tbl tr.rowlink:hover td { background: var(--tint); }
.tbl tr.dim td { opacity: .55; }
.tbl .cb { width: 34px; } .tbl .empty { text-align: center; color: var(--grey); padding: 30px; }
.tbl.compact td { padding: 6px 10px; }
.tbl input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue); }
.tbl td .copyrow input { min-width: 260px; }
.chip { display: inline-block; font-size: .72rem; font-weight: 500; border-radius: 999px; padding: 2px 9px; background: var(--tint); color: var(--blue); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.flag { background: var(--flag-bg); color: var(--flag); }
.chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.new { background: var(--blue); color: #fff; } .chip.ghost { background: #eef1f5; color: var(--grey); }
.bulkbar { display: flex; gap: 8px; align-items: center; margin-top: 10px; } .bulkbar select { width: auto; min-height: 36px; padding: 6px 10px; }
.assign { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 20px; align-items: start; border-left: 4px solid var(--blue); }
.assign .big { font-size: 1.05rem; font-weight: 500; margin: 2px 0; color: var(--navy); }
.assign-form { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 900px) { .assign { grid-template-columns: 1fr; } }
.sec h2 { border-bottom: 2px solid var(--blue); padding-bottom: 6px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 24px; margin: 0; }
.kv div { min-width: 0; } .kv dt { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--grey); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.kv .yn-row { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 70px; padding: 4px 8px; border-radius: 6px; }
.kv .yn-row dt { text-transform: none; letter-spacing: 0; font-size: .85rem; color: var(--ink); } .kv .yn-row dd { font-weight: 500; }
.kv .yn-row.flag { background: var(--flag-bg); } .kv .yn-row.flag dd { color: var(--flag); }
.danger summary { color: var(--flag); cursor: pointer; font-weight: 500; }
details.card summary { cursor: pointer; }
.form-grid { margin-top: 14px; }
.flash { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; font-size: .9rem; }
.flash.ok { background: var(--ok-bg); color: #0d4f31; border: 1px solid #b7e2cb; } .flash.error { background: var(--flag-bg); color: var(--flag); border: 1px solid #f5c2bd; }
.reveal .big { font-size: 1.1rem; background: #fff; padding: 2px 8px; border-radius: 6px; } .reveal p { margin: 6px 0 0; font-size: .82rem; }
form.inline { display: inline; margin: 0 8px 0 0; } .tbl select { min-height: 32px; padding: 4px 8px; font-size: .85rem; width: auto; }
.actions-cell { white-space: nowrap; }
.inline-note { margin-top: 12px; display: flex; gap: 10px; align-items: center; }
.narrow-card { max-width: 520px; }
.back { text-decoration: none; font-size: .85rem; }

/* auth */
body.auth { background: var(--navy); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; padding: 28px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-foot { color: #8fa7c1; font-size: .75rem; text-align: center; }
.qr { display: grid; place-items: center; margin: 10px 0; } .qr img { border: 1px solid var(--line); border-radius: 8px; }
.code { font-size: 1.4rem !important; letter-spacing: .3em; text-align: center; }
.steps-list { font-size: .88rem; padding-left: 1.2rem; }


/* ------------------------------------------------ Excel brand overrides */
h1, h2 { letter-spacing: -.01em; }
h1 { font-weight: 800; } h2 { font-weight: 700; }
input, select, textarea { border-color: #d6cfc8 !important; background: #fffdfb !important; }
input:focus, select:focus, textarea:focus { border-color: var(--orange) !important; box-shadow: 0 0 0 3px rgba(250,100,20,.2) !important; background: #fff !important; }
.btn { background: var(--orange); border-color: var(--orange); color: #111; font-weight: 700; letter-spacing: .01em; }
.btn:hover { background: var(--orange-hover); border-color: var(--orange-hover); color: #111; }
.btn.ghost { background: #fff; color: #111; border-color: #111; } .btn.ghost:hover { background: #111; color: #fff; }
.step-h { border-bottom-color: var(--orange); }
.step-h .num { background: var(--orange); color: #111; border-radius: 4px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); width: 30px; height: 32px; }
.pill input:checked + span { background: #111; border-color: #111; color: #fff; }
.pill input:focus-visible + span, .yn-opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(250,100,20,.35); }
.yn-no input:checked + span { background: #111; border-color: #111; }
.yn-q b { color: var(--orange); }
.check input, .tbl input[type=checkbox] { accent-color: var(--orange); }
.progress li.done::before, .progress li.on::before { background: var(--orange); }
.notice, .intro { border-left-color: var(--orange); }
.sign { border-color: var(--orange); background: var(--tint); }
.chip { background: var(--tint); color: var(--blue); }
.chip.new { background: var(--orange); color: #111; }
.tag { background: #111; color: var(--orange); }
.tbl th { background: #141414; }
.sec h2 { border-bottom-color: var(--orange); }
.assign { border-left-color: var(--orange); }
.admin-bar { border-bottom: 3px solid var(--orange); }
.admin-bar nav a.on, .admin-bar nav a:hover { background: var(--tint); color: #111; box-shadow: inset 0 -2px 0 var(--orange); border-radius: 6px 6px 0 0; }
.tbl tr.rowlink:hover td { background: var(--tint); }
img.logo { height: 44px; }
.admin-brand img.logo { height: 30px; } .auth-brand img.logo { height: 38px; }

/* hero: black with Excel's orange mountain ridge */
.hero { background: #111; }
.hero::before { width: 520px; height: 260px; border-radius: 0; right: -40px; top: auto; bottom: 0; background: var(--orange);
  clip-path: polygon(0 100%, 30% 38%, 45% 62%, 70% 6%, 100% 60%, 100% 100%); opacity: .95; }
.hero::after { width: 420px; height: 170px; border-radius: 0; right: 20px; top: auto; bottom: 0; background: #2a2a2a;
  clip-path: polygon(0 100%, 26% 44%, 38% 70%, 62% 18%, 84% 58%, 100% 40%, 100% 100%); }
.hero .tagline { color: #ffb07f; }
.hero .sub { color: #d9d3cd; }
.hero-in { padding-bottom: 36px; }
@media (max-width: 640px) { .hero::before { width: 300px; height: 150px; opacity: .9; } .hero::after { width: 240px; height: 100px; } }
body.auth { background: #111 url(/static/img/excel-mark-white.png) no-repeat right -60px bottom -60px / 420px; }
.auth-foot { color: #a39b93; }
.done .tick { background: var(--tint); color: var(--orange); }
.ref { color: #111; }
