/* ServiceChannel Provider demo. Tokens from servicechannel.com: navy #061C4C,
   cyan bracket logo, Myriad Pro (Source Sans 3 as the free stand-in), 4px
   corners, gray #F7F7F8 surfaces, #E1E4E6 hairlines. */
:root {
  --navy: #061c4c; --navy-2: #0b2a6b; --cyan: #1fb6e5; --cyan-dark: #0f9fd0; --blue: #3860be;
  --ink: #1b1f2a; --muted: #5f6b78; --faint: #8a94a0;
  --bg: #f7f7f8; --surface: #ffffff; --line: #e1e4e6; --line-2: #eceef1; --tint: #eaf1fa;
  --green: #1f9d5a; --green-bg: #e8f6ee; --amber: #d9860b; --amber-bg: #fdf3e3; --red: #d0342c; --red-bg: #fdeceb;
  --shadow: 0 1px 2px rgba(6,28,76,.06), 0 4px 14px rgba(6,28,76,.06);
  --r: 6px; --font: "Source Sans 3", "Myriad Pro", "Segoe UI", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { color: var(--navy); font-weight: 700; line-height: 1.2; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.right { text-align: right; } .center { text-align: center; }
.row { display: flex; align-items: center; gap: 12px; } .between { justify-content: space-between; } .wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 4px; border: 1px solid var(--navy); background: var(--navy); color: #fff; font-weight: 600; font-size: 14px;
  cursor: pointer; white-space: nowrap; touch-action: manipulation; transition: background .15s, border-color .15s, color .15s; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.secondary { background: #fff; color: var(--navy); border-color: var(--line); }
.btn.ghost { background: transparent; color: var(--navy); border-color: transparent; }
.btn.cyan { background: var(--cyan); border-color: var(--cyan); color: #fff; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
@media (hover: hover) {
  .btn:hover { background: var(--navy-2); border-color: var(--navy-2); }
  .btn.secondary:hover { background: var(--bg); border-color: #c9cfd6; }
  .btn.ghost:hover { background: var(--tint); }
  .btn.cyan:hover { background: var(--cyan-dark); border-color: var(--cyan-dark); }
  a:hover { text-decoration: underline; }
}

/* ---- app shell ---- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.topbar .inner { max-width: 1320px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand img { height: 22px; width: auto; }
.brand .product { font-weight: 600; color: var(--muted); font-size: 14px; border-left: 1px solid var(--line); padding-left: 10px; white-space: nowrap; }
.nav { display: flex; gap: 2px; height: 60px; flex-shrink: 0; }
.nav a { display: inline-flex; align-items: center; padding: 0 14px; color: var(--navy); font-weight: 600; font-size: 15px; border-bottom: 3px solid transparent; white-space: nowrap; }
.nav a.active { border-bottom-color: var(--cyan); }
.nav a .pill { margin-left: 6px; }
.topbar .spacer { flex: 1; }
.iconbtn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; color: var(--navy); cursor: pointer; position: relative; }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }
.user { display: flex; align-items: center; gap: 10px; padding-left: 14px; border-left: 1px solid var(--line); flex-shrink: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.user .signout { margin-left: 4px; font-size: 12px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.user .signout:hover { color: var(--navy); text-decoration: underline; }
.user .who { line-height: 1.15; white-space: nowrap; } .user .who b { display: block; font-size: 14px; color: var(--navy); } .user .who span { font-size: 12px; color: var(--muted); }

.page { max-width: 1320px; margin: 0 auto; padding: 28px 24px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; } .crumbs a { color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card .card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card .card-h h3 { font-size: 15px; }
.card .card-b { padding: 18px; }
.grid { display: grid; gap: 18px; }
.g4 { grid-template-columns: repeat(4, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g2 { grid-template-columns: repeat(2, 1fr); }
.g-2-1 { grid-template-columns: 2fr 1fr; } .g-1-2 { grid-template-columns: 1fr 2fr; }

/* KPI tiles */
.kpi { padding: 16px 18px; }
.kpi .label { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.kpi .value { font-size: 30px; font-weight: 700; color: var(--navy); margin-top: 6px; line-height: 1; }
.kpi .delta { font-size: 13px; margin-top: 8px; } .up { color: var(--green); } .down { color: var(--red); }

/* pills / status */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.green { background: var(--green-bg); color: var(--green); } .pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.red { background: var(--red-bg); color: var(--red); } .pill.blue { background: var(--tint); color: var(--blue); } .pill.gray { background: var(--line-2); color: var(--muted); }
.pill.navy { background: var(--navy); color: #fff; }

/* alerts */
.alert { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); border: 1px solid; }
.alert.red { background: var(--red-bg); border-color: #f3c9c6; } .alert.amber { background: var(--amber-bg); border-color: #f1dcb4; } .alert.green { background: var(--green-bg); border-color: #bfe6cf; } .alert.blue { background: var(--tint); border-color: #cfdff2; }
.alert .ico { width: 22px; height: 22px; flex: none; margin-top: 1px; } .alert.red .ico { color: var(--red); } .alert.amber .ico { color: var(--amber); } .alert.green .ico { color: var(--green); } .alert.blue .ico { color: var(--blue); }
.alert b { color: var(--navy); }
.alert .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex: none; }

/* tables */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.clickable { cursor: pointer; } .tbl tr.flag td { background: #fff9f0; }
@media (hover: hover) { .tbl tr.clickable:hover td { background: var(--tint); } }
.tbl .wo { font-weight: 700; color: var(--navy); font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.brandcell { display: flex; align-items: center; gap: 10px; }
.brandmark { width: 30px; height: 30px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; color: #fff; flex: none; }

/* score ring */
.ring { --p: 80; --c: var(--green); width: 120px; height: 120px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line-2) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 11px; background: #fff; border-radius: 50%; }
.ring b { position: relative; font-size: 32px; color: var(--navy); } .ring small { position: relative; display: block; text-align: center; color: var(--muted); font-size: 11px; margin-top: -4px; }
.scorechips { display: flex; gap: 8px; flex-wrap: wrap; }
.scorechip { border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; background: #fff; font-size: 13px; }
.scorechip b { color: var(--navy); margin-left: 6px; }

/* requirement rows (compliance) */
.req { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.req:last-child { border-bottom: 0; }
.req .st { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.req .st.ok { background: var(--green-bg); color: var(--green); } .req .st.bad { background: var(--red-bg); color: var(--red); } .req .st.warn { background: var(--amber-bg); color: var(--amber); }
.req .st svg { width: 15px; height: 15px; }
.req .t b { color: var(--navy); display: block; } .req .t span { font-size: 13px; color: var(--muted); }
.req .end { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; color: var(--navy); }
.field label .opt { font-weight: 400; color: var(--faint); }
.field input, .field select, .field textarea { height: 42px; padding: 0 12px; border: 1px solid #c9cfd6; border-radius: 4px; background: #fff; width: 100%; }
.field textarea { height: auto; padding: 10px 12px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid rgba(31,182,229,.35); border-color: var(--cyan); }
.field input:read-only { background: var(--bg); color: var(--muted); }
.field .hint { font-size: 12px; color: var(--faint); }
.field.invalid input, .field.invalid select { border-color: var(--red); }
.field .err { display: none; font-size: 12px; color: var(--red); } .field.invalid .err { display: block; }
.fields { display: grid; gap: 14px 16px; } .fields.c2 { grid-template-columns: 1fr 1fr; } .fields.c3 { grid-template-columns: 1fr 1fr 1fr; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; } .check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--navy); }

/* insurance flow */
.steps { display: flex; gap: 0; margin-bottom: 22px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; }
.steps div { flex: 1; padding: 12px 16px; font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 10px; border-right: 1px solid var(--line-2); }
.steps div:last-child { border-right: 0; }
.steps .n { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.steps div.on { color: var(--navy); } .steps div.on .n { border-color: var(--navy); background: var(--navy); color: #fff; }
.steps div.done .n { border-color: var(--green); background: var(--green); color: #fff; }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tier { border: 2px solid var(--line); border-radius: var(--r); padding: 18px; background: #fff; cursor: pointer; position: relative; transition: border-color .15s, box-shadow .15s; }
.tier.sel { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(6,28,76,.08); }
.tier .rec { position: absolute; top: -11px; left: 14px; }
.tier .lim { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.tier .amt { font-size: 28px; font-weight: 800; color: var(--navy); margin: 8px 0 2px; }
.tier .amt small { font-size: 14px; color: var(--muted); font-weight: 600; }
.tier ul { list-style: none; margin-top: 12px; font-size: 13.5px; color: var(--ink); }
.tier li { padding: 4px 0 4px 22px; position: relative; }
.tier li::before { content: ""; position: absolute; left: 0; top: 8px; width: 14px; height: 14px; background: var(--green);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"/></svg>') center/contain no-repeat; mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="black" d="M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"/></svg>') center/contain no-repeat; }
.tier .meets { margin-top: 12px; }
.addon { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.addon + .addon { margin-top: 10px; }
.carrier-logo { width: 34px; height: 34px; flex-shrink: 0; border-radius: 8px; border: 1px solid var(--line); object-fit: contain; background: #fff; }
.carrier-logo.sm { width: 22px; height: 22px; border-radius: 6px; }
.addon input { width: 18px; height: 18px; accent-color: var(--navy); }
.addon .t b { color: var(--navy); display: block; } .addon .t span:not(.pill) { font-size: 13px; color: var(--muted); }
.addon .price { margin-left: auto; font-weight: 700; color: var(--navy); white-space: nowrap; }
.summary { position: sticky; top: 80px; }
.summary .line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.summary .line:last-of-type { border-bottom: 0; }
.summary .total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; margin-top: 6px; border-top: 2px solid var(--navy); }
.summary .total b { font-size: 26px; color: var(--navy); } .summary .total b small { font-size: 13px; color: var(--muted); font-weight: 600; }
.carrier { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.carrier b { color: var(--navy); }
.powered { font-size: 12px; color: var(--faint); display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.error-box { display: none; background: var(--red-bg); border: 1px solid #f3c9c6; color: var(--red); border-radius: 4px; padding: 10px 14px; font-size: 14px; margin: 12px 0; } .error-box.show { display: block; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--navy); animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
#payment-element { min-height: 120px; }
.cert-preview { border: 1px solid var(--line); border-radius: var(--r); background: #fff; padding: 20px; font-size: 13px; }
.cert-preview .hdr { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--navy); padding-bottom: 10px; margin-bottom: 12px; }
.cert-preview .hdr b { font-size: 15px; color: var(--navy); }
.cert-preview table { width: 100%; border-collapse: collapse; } .cert-preview td { padding: 5px 0; border-bottom: 1px solid var(--line-2); } .cert-preview td:last-child { text-align: right; font-weight: 600; }
.receipt-ico { width: 64px; height: 64px; border-radius: 50%; background: var(--green-bg); color: var(--green); display: grid; place-items: center; margin: 0 auto 14px; } .receipt-ico svg { width: 30px; height: 30px; }

/* portal frame */
#portal-frame { width: 100%; border: 0; min-height: 600px; background: #fff; display: block; overflow: hidden; }
.frame-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }

/* login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-side { background: linear-gradient(135deg, var(--navy) 0%, #0b2a6b 55%, #1596cf 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-side h1 { color: #fff; font-size: 40px; line-height: 1.1; max-width: 520px; }
.login-side p { color: rgba(255,255,255,.85); font-size: 17px; max-width: 520px; margin-top: 14px; }
.login-side .stats { display: flex; gap: 32px; margin-top: 36px; } .login-side .stats b { display: block; font-size: 28px; } .login-side .stats span { font-size: 13px; color: rgba(255,255,255,.75); }
.login-main { display: flex; align-items: center; justify-content: center; padding: 40px; background: #fff; }
.login-box { width: 100%; max-width: 400px; }
.login-box .brand img { height: 28px; }
.login-box h2 { margin: 28px 0 6px; font-size: 24px; }
.login-box .sub { color: var(--muted); margin-bottom: 22px; }
.login-box .field { margin-bottom: 14px; }
.login-box .foot { margin-top: 18px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }
.demo-ribbon { background: #fff7e6; color: #8a5b00; border-bottom: 1px solid #f0d9a8; font-size: 12.5px; text-align: center; padding: 6px 12px; }
footer.app-foot { max-width: 1320px; margin: 0 auto; padding: 20px 24px 40px; font-size: 12.5px; color: var(--faint); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
footer.app-foot a { color: var(--faint); }

/* drawer */
.drawer-bg { position: fixed; inset: 0; background: rgba(6,28,76,.35); z-index: 60; display: none; }
.drawer-bg.open { display: block; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 520px; max-width: 100%; background: #fff; z-index: 61; box-shadow: -10px 0 40px rgba(6,28,76,.18); transform: translateX(100%); transition: transform .22s ease; overflow-y: auto; }
.drawer.open { transform: none; }
.drawer .d-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.drawer .d-b { padding: 20px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 14px; } .kv dt { color: var(--muted); } .kv dd { color: var(--ink); font-weight: 600; }

@media (max-width: 1280px) {
  .nav a { padding: 0 10px; font-size: 14px; } .brand .product { display: none; }
}
@media (max-width: 1180px) {
  .user .who { display: none; }
}
@media (max-width: 1000px) {
  /* Below this the nav is wider than the room left for it, so it scrolls
     rather than pushing the page sideways. */
  .nav { flex-shrink: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
}
@media (max-width: 1024px) {
  .g4 { grid-template-columns: repeat(2, 1fr); } .g3, .g-2-1, .g-1-2 { grid-template-columns: 1fr; } .tiers { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; } .login-side { display: none; }
  .summary { position: static; }
}
@media (max-width: 640px) {
  .topbar .inner { padding: 0 14px; gap: 12px; } .brand .product { display: none; } .nav { overflow-x: auto; }
  .page { padding: 18px 14px 40px; } .g4, .g2, .fields.c2, .fields.c3 { grid-template-columns: 1fr; }
  .steps { flex-wrap: wrap; } .steps div { flex: 1 1 50%; }
  .alert .actions { margin-left: 0; width: 100%; } .alert { flex-wrap: wrap; }
}
