/*
 * Client Portal - the "Client Portal" mockup's design, as plain CSS.
 * No build step and no web fonts: Optra's file import accepts no font files,
 * and the mockup's own stack is system fonts.
 *
 * Colours are tokens; text colours meet WCAG 2.1 AA contrast on their
 * backgrounds (CP-NFR-04). --ink-3 was darkened from the mockup's #848A90,
 * which fails AA for small text on white.
 */
:root {
  --teal: #0A464E; --teal-d: #073940; --teal-l: #4E7E86;
  --red: #C7201A; --red-d: #A51A13;
  --page: #F5F6F7; --surface: #FFFFFF; --border: #E3E4E7; --border-2: #ECEDEF;
  --ink: #1B1E21; --ink-2: #4A4F54; --ink-3: #686E74;
  --good: #0B7A4B; --good-bg: #E8F5EE; --info: #1D6FB0; --info-bg: #EAF2FB;
  --warn: #8F5D00; --warn-bg: #FFF6E6;
  --rec: #6B7A8F; --proc: #2A78D6; --done: #1BAF7A; --deliv: #0B7A4B; --await: #C3C8CE;
  --focus: #F2B705;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--page); color: var(--ink); font-size: 14.5px; line-height: 1.5; }
a { color: var(--teal); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: #fff; color: var(--teal); padding: 8px 12px; border-radius: 6px; z-index: 50; }
.skip:focus { left: 8px; }

/* header */
.ph { background: var(--teal); color: #fff; display: flex; align-items: center; min-height: 62px; padding: 0 28px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.brand .x { font-weight: 800; font-size: 23px; letter-spacing: -0.5px; }
.brand .x sup { font-size: 9px; font-weight: 400; }
.brand .bar { width: 1px; height: 26px; background: rgba(255,255,255,.3); }
.brand .portal { font-size: 14px; font-weight: 500; color: #CFE4E6; letter-spacing: .3px; }
.acct { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.acct .client { text-align: right; font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.acct .client small { display: block; font-weight: 400; font-size: 11.5px; color: #CFE4E6; }
.acct .avatar { width: 38px; height: 38px; border-radius: 50%; background: #fff; color: var(--teal); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.acct .avatar:empty { visibility: hidden; }

/* freshness strip, CP-UI-02 */
.asof { background: #EDEFF1; border-bottom: 1px solid var(--border); font-size: 12.5px; color: var(--ink-2); padding: 8px 28px; display: flex; align-items: center; gap: 10px; }
.asof .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex: none; }
.asof b { color: var(--ink); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 28px 50px; }
.wrap:focus { outline: none; }

/* hero */
.hero { display: flex; gap: 26px; align-items: center; background: linear-gradient(110deg, var(--teal), #0d5a63); color: #fff; border-radius: 14px; padding: 26px 30px; margin-bottom: 22px; }
.hero .ht { flex: 1; min-width: 0; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: #BFE3E6; font-weight: 600; }
.hero h1 { font-size: 27px; font-weight: 700; margin: 4px 0 10px; letter-spacing: -0.3px; }
.meta { display: flex; gap: 22px; flex-wrap: wrap; font-size: 13.5px; }
.meta dt { color: #BFE3E6; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; }
.meta dd { font-weight: 600; font-size: 15px; }
.statpill { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); border-radius: 20px; padding: 3px 12px; font-size: 13px; font-weight: 600; }
.statpill .d { width: 9px; height: 9px; border-radius: 50%; background: #5BE3A6; }
.statpill[data-status="not_started"] .d { background: #CFE4E6; }
.statpill[data-status="completed"] .d { background: #FFD66B; }
.statpill[data-status="on_hold"] .d { background: #F2B705; }
.ring { flex: none; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(192px, 1fr)); gap: 16px; margin-bottom: 22px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
.tile .tl { font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.ic { width: 26px; height: 26px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; background: #EEF1F4; }
.ic-proc { background: var(--info-bg); } .ic-done { background: var(--good-bg); } .ic-pages { background: #EDE7F7; } .ic-await { background: #F3F0EA; }
.tile .tv { font-size: 28px; font-weight: 700; letter-spacing: -0.4px; font-variant-numeric: tabular-nums; }
.tile .tv small { font-size: 13px; font-weight: 400; color: var(--ink-3); }
.tile .td2 { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }

/* sections */
.sect { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 22px 24px; margin-bottom: 22px; }
.sect h1 { font-size: 22px; margin-bottom: 6px; }
.sect h2 { font-size: 17px; font-weight: 700; margin-bottom: 3px; }
.sub { font-size: 13px; color: var(--ink-3); margin-bottom: 18px; }
.tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--warn); background: var(--warn-bg); border: 1px solid #F0E0BE; border-radius: 5px; padding: 2px 8px; vertical-align: middle; margin-left: 8px; }
.grid2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; }
.grid2 > .sect { margin-bottom: 22px; }
.wide-gap { gap: 30px; align-items: start; }
.empty, .placeholder { color: var(--ink-2); font-size: 13.5px; background: #F7F8F9; border: 1px dashed var(--border); border-radius: 10px; padding: 16px 18px; }
.welcome { text-align: center; padding: 48px 24px; }
.welcome p { color: var(--ink-2); max-width: 560px; margin: 8px auto 20px; }

/* engagement picker, CP-F-011 */
.picker { margin-bottom: 18px; }
.picker-label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); margin-bottom: 8px; font-weight: 600; }
.picker-list { display: flex; gap: 10px; flex-wrap: wrap; }
.pick { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--surface); border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 14px; min-width: 220px; }
.pick span { font-size: 12.5px; color: var(--ink-3); }
.pick.on { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }

/* lifecycle bar */
.lcbar { display: flex; height: 46px; border-radius: 9px; overflow: hidden; border: 1px solid var(--border); }
.lcseg { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12.5px; font-weight: 700; min-width: 6px; }
.lclegend { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.lcitem { display: flex; gap: 10px; align-items: flex-start; }
.lcitem .sw { width: 13px; height: 13px; border-radius: 4px; margin-top: 3px; flex: none; }
.lcitem .n { font-size: 18px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.lcitem .l { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.t-deliv { background: var(--deliv); } .t-done { background: var(--done); } .t-proc { background: var(--proc); }
.t-digi { background: #14946A; } .t-rec { background: var(--rec); } .t-await { background: var(--await); color: #3E4348 !important; }

.chart { width: 100%; height: auto; display: block; }

/* tables */
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
thead th { text-align: left; padding: 11px 12px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--ink-3); border-bottom: 2px solid var(--border); }
tbody th, td { padding: 12px; border-bottom: 1px solid var(--border-2); vertical-align: middle; text-align: left; }
tbody th { font-weight: 700; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 20px; padding: 3px 11px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill .d { width: 8px; height: 8px; border-radius: 50%; }
.pill.ok { background: var(--good-bg); color: var(--good); } .pill.ok .d { background: var(--good); }
.pill.qa { background: var(--info-bg); color: var(--info); } .pill.qa .d { background: var(--info); }
.pill.sch { background: #F0F1F3; color: var(--ink-2); } .pill.sch .d { background: var(--ink-3); }

/* forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field .opt { font-weight: 400; color: var(--ink-3); }
.field select, .field input, .field textarea { width: 100%; border: 1px solid #C9CCD1; border-radius: 8px; padding: 10px 12px; font-size: 14px; font-family: inherit; color: var(--ink); background: #fff; }
.field textarea { resize: vertical; min-height: 110px; }
.btn { display: inline-block; text-decoration: none; background: var(--red); color: #fff; border: none; border-radius: 8px; padding: 11px 20px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn:hover { background: var(--red-d); }
.btn:disabled { opacity: .7; cursor: progress; }
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn.ghost { background: #fff; color: var(--teal); border: 1.5px solid var(--teal); }
.btn.ghost:hover { background: #F0F6F6; }
.btn.ghost-light { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.6); margin-top: 14px; }
.ok-msg, .fail-msg, .form-error { border-radius: 8px; padding: 11px 14px; font-size: 13px; font-weight: 600; margin-top: 10px; }
.ok-msg { background: var(--good-bg); color: var(--good); border: 1px solid #BFE4CE; }
.fail-msg, .form-error { background: #FDECEC; color: #9B1C14; border: 1px solid #F3C6C3; }
.contact { list-style: none; font-size: 13.5px; color: var(--ink-2); line-height: 1.9; }

/* upsell, CP-UI-60: visually distinct from account data */
.promo { background: linear-gradient(110deg, #1B1E21, #2b3a40); color: #fff; border-radius: 14px; padding: 26px 30px; margin-bottom: 18px; }
.promo .k { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: #A8DDE0; font-weight: 600; }
.promo h1, .promo h2 { font-size: 23px; font-weight: 700; margin: 6px 0 4px; letter-spacing: -0.3px; }
.promo p { color: #D5DADE; font-size: 14px; max-width: 720px; }
.ucards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.ucard { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; }
.ucard .ic { width: 42px; height: 42px; border-radius: 10px; background: var(--good-bg); font-size: 20px; margin-bottom: 12px; }
.ucard h2 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.ucard p { font-size: 13px; color: var(--ink-2); flex: 1; margin-bottom: 14px; }
.ucard .btn { align-self: flex-start; }

/* help */
.prose h2 { margin: 22px 0 8px; }
.faq dt { font-weight: 700; margin-top: 14px; }
.faq dd { color: var(--ink-2); margin-top: 3px; }

/* footer */
.ft { color: var(--ink-3); font-size: 12.5px; padding: 26px 28px 34px; text-align: center; border-top: 1px solid var(--border); margin-top: 10px; }
.ft p + p { margin-top: 6px; }
.ft b { color: var(--ink-2); }
.ftnav { display: flex; justify-content: center; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.ftnav a[aria-current="page"] { font-weight: 700; text-decoration: none; }

/* loading skeletons */
.skel { background: linear-gradient(90deg, #ECEEF0 0%, #F6F7F8 50%, #ECEEF0 100%); background-size: 200% 100%; border-radius: 12px; min-height: 104px; animation: shimmer 1.4s infinite linear; }
.hero-skel { min-height: 170px; margin-bottom: 22px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* small screens, CP-NFR-05 */
@media (max-width: 880px) { .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .ph, .asof { padding-left: 16px; padding-right: 16px; }
  .wrap { padding: 16px 16px 40px; }
  .brand .bar, .brand .portal { display: none; }
  .acct .client { font-size: 12.5px; }
  .hero { flex-direction: column; align-items: flex-start; padding: 20px; }
  .hero h1 { font-size: 22px; }
  .ring { align-self: center; }
  .sect { padding: 18px 16px; }
  .tile .tv { font-size: 24px; }
}

/* box lookup, CP-UI-40 */
.search { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.search input { flex: 1 1 260px; border: 1px solid #C9CCD1; border-radius: 8px; padding: 10px 12px; font-size: 15px; font-family: inherit; }
.search select { border: 1px solid #C9CCD1; border-radius: 8px; padding: 10px 12px; font-size: 14px; font-family: inherit; background: #fff; }
.count { font-size: 12.5px; color: var(--ink-3); margin-bottom: 12px; min-height: 1.5em; }
.box { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.box header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.milestones { list-style: none; display: grid; grid-template-columns: repeat(var(--steps, 4), 1fr); gap: 6px; }
.ms { position: relative; padding-top: 18px; font-size: 12.5px; color: var(--ink-3); }
.ms .dot { position: absolute; top: 0; left: 0; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--await); background: #fff; }
.ms::before { content: ""; position: absolute; top: 5px; left: 14px; right: -4px; height: 2px; background: var(--border); }
.ms:last-child::before { display: none; }
.ms.done .dot, .ms.now .dot { border-color: var(--good); background: var(--good); }
.ms.done::before { background: var(--good); }
.ms.done, .ms.now { color: var(--ink); }
.ms.now .ml { font-weight: 700; }
.ms .when { display: block; color: var(--ink-3); font-size: 11.5px; }
@media (max-width: 640px) { .milestones { grid-template-columns: 1fr 1fr; row-gap: 14px; } .ms::before { display: none; } }
