/*
 * CertificateCraftZ portal styles.
 * Brand colors and fonts are NOT set here. They come from /assets/brand.css,
 * which is written from the agency directory (the --ba-* tokens). Another
 * agency changes the tokens, not this file.
 * The --ccz-* tokens below are the neutral system colors every agency shares.
 */
:root {
  --ccz-white: #FFFFFF;
  --ccz-canvas: #F6F7F9;
  --ccz-line-soft: #ECEEF1;
  --ccz-field: #8A929C;
  --ccz-ok: #107C10;
  --ccz-ok-bg: #F1FAF1;
  --ccz-warn-bg: #FFF9C3;
  --ccz-bad: #B10E1C;
  --ccz-bad-bg: #FEF0F1;
  --ccz-neutral: #616161;
  --ccz-neutral-bg: #F0F0F0;
  --ccz-note: #5C4500;
  --ccz-note-bg: #FFF4CE;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ccz-canvas);
  color: var(--ba-ink);
  font-family: var(--ba-font-body);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1 { font-family: var(--ba-font-display); font-weight: 600; font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
h2 { font-size: 16px; font-weight: 600; line-height: 1.3; }
h3 { font-size: 15px; font-weight: 600; }
a { color: var(--ba-blue-500); font-weight: 500; text-underline-offset: 2px; }
a:hover { color: var(--ba-blue); }
:focus-visible { outline: 3px solid var(--ba-blue-500); outline-offset: 2px; }
.top :focus-visible { outline-color: var(--ccz-white); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ccz-white); color: var(--ba-blue); padding: var(--s2) var(--s4); z-index: 10; }
.skip:focus { left: var(--s2); top: var(--s2); }
.meta { font-size: 13px; color: var(--ba-slate); }
.mono { font-family: var(--ba-font-mono); }
.num { font-variant-numeric: tabular-nums; }

/* Top bar and navigation */
.top { background: var(--ba-blue); color: var(--ccz-white); }
.top-in { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); padding: var(--s3) var(--s4); max-width: 1180px; margin: 0 auto; width: 100%; }
.brand { font-family: var(--ba-font-display); font-weight: 600; font-size: 19px; color: var(--ccz-white); text-decoration: none; }
.brand small { font-family: var(--ba-font-body); font-weight: 400; font-size: 13px; opacity: .85; margin-left: var(--s2); }
.top-right { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); }
.switch { color: var(--ccz-white); border: 1px solid var(--ccz-white); border-radius: var(--ba-radius); padding: 6px 10px; text-decoration: none; font-weight: 500; }
.switch:hover { color: var(--ccz-white); background: var(--ba-blue-900); }
.user { display: flex; align-items: center; gap: var(--s2); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ba-blue-500); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.top .linkbtn { color: var(--ccz-white); }
.nav { background: var(--ccz-white); border-bottom: 1px solid var(--ba-mist); }
.nav ul { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 var(--s4); max-width: 1180px; margin: 0 auto; }
.nav a { display: block; padding: 12px 12px 9px; color: var(--ba-slate); font-weight: 500; text-decoration: none; border-bottom: 3px solid transparent; }
.nav a:hover { color: var(--ba-blue); }
.nav a[aria-current="page"] { color: var(--ba-blue); border-bottom-color: var(--ba-orange); }

main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s7); display: flex; flex-direction: column; gap: var(--s4); }
main.narrow { max-width: 460px; }
.foot { border-top: 1px solid var(--ba-mist); background: var(--ccz-white); color: var(--ba-slate); font-size: 13px; padding: var(--s3) var(--s4); text-align: center; }

.row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.row > .push { margin-left: auto; }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.grid { display: grid; gap: var(--s4); align-items: start; }
.card { background: var(--ccz-white); border: 1px solid var(--ba-mist); border-radius: var(--ba-radius); padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.card.paper { background: var(--ba-paper); }
@media (min-width: 860px) {
  .g-21 { grid-template-columns: 2fr 1fr; }
  .g-32 { grid-template-columns: 3fr 2fr; }
  .g-45 { grid-template-columns: 4fr 5fr; }
  .g-2 { grid-template-columns: 1fr 1fr; }
}

/* Buttons. One primary button per screen. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; min-height: 40px; border: 1px solid var(--ccz-field); border-radius: var(--ba-radius); background: var(--ccz-white); color: var(--ba-ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; text-align: center; }
.btn:hover { border-color: var(--ba-blue); color: var(--ba-blue); }
.btn.pri { background: var(--ba-blue); border-color: var(--ba-blue); color: var(--ccz-white); }
.btn.pri:hover, .btn.pri:active { background: var(--ba-blue-900); border-color: var(--ba-blue-900); color: var(--ccz-white); }
.btn.block { display: flex; width: 100%; }
.btn.sm { padding: 5px 10px; min-height: 32px; font-size: 14px; }

/* Forms */
label, .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: var(--s1); }
input[type="text"], input[type="email"], input[type="date"], input[type="file"], select, textarea {
  display: block; width: 100%; padding: 9px 10px; min-height: 40px; border: 1px solid var(--ccz-field); border-radius: var(--ba-radius);
  background: var(--ccz-white); color: var(--ba-ink); font: inherit;
}
textarea { min-height: 120px; resize: vertical; }
input.code { font-family: var(--ba-font-mono); font-size: 22px; letter-spacing: .3em; text-align: center; }
.field { display: flex; flex-direction: column; }
.field .meta { margin-top: var(--s1); }
.fields-2 { display: grid; gap: var(--s3); }
@media (min-width: 620px) { .fields-2 { grid-template-columns: 1fr 1fr; } .fields-3 { display: grid; gap: var(--s3); grid-template-columns: 2fr 1fr 1fr; } }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--s2); }
legend { font-weight: 600; font-size: 16px; padding: 0; margin-bottom: var(--s1); }
.opt { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; padding: 10px 12px; border: 1px solid var(--ba-mist); border-radius: var(--ba-radius); background: var(--ccz-white); margin: 0; font-weight: 400; font-size: 15px; cursor: pointer; }
.opt input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ba-blue); }
.opt:has(input:checked) { border-color: var(--ba-blue); background: var(--ba-blue-50); }
.opt b { display: block; font-weight: 600; }
.opt.off { background: var(--ccz-canvas); color: var(--ba-slate); cursor: default; }
.readbox { border: 1px solid var(--ba-mist); background: var(--ccz-canvas); border-radius: var(--ba-radius); padding: 8px 10px; font-size: 14px; overflow-wrap: anywhere; }

/* Messages. Status is always a word, and a color as well. */
.msg { padding: 10px 12px; border-radius: var(--ba-radius); border: 1px solid transparent; }
.msg.ok { background: var(--ccz-ok-bg); color: var(--ccz-ok); border-color: var(--ccz-ok); }
.msg.bad { background: var(--ccz-bad-bg); color: var(--ccz-bad); border-color: var(--ccz-bad); }
.msg.note { background: var(--ccz-note-bg); color: var(--ccz-note); border-color: var(--ccz-note); }
.msg ul { list-style: disc; padding-left: 20px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.pill.ok { background: var(--ccz-ok-bg); color: var(--ccz-ok); }
.pill.warn { background: var(--ccz-warn-bg); color: var(--ba-ink); }
.pill.bad { background: var(--ccz-bad-bg); color: var(--ccz-bad); }
.pill.neu { background: var(--ccz-neutral-bg); color: var(--ccz-neutral); }
.status-big { padding: var(--s4); border-radius: var(--ba-radius); display: flex; flex-direction: column; gap: 2px; }
.status-big b { font-family: var(--ba-font-display); font-weight: 600; font-size: 24px; line-height: 1.2; }
.status-big.ok { background: var(--ccz-ok-bg); color: var(--ccz-ok); }
.status-big.bad { background: var(--ccz-bad-bg); color: var(--ccz-bad); }
.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 6px 10px; }
.kv dt { color: var(--ba-slate); }
.kv dd { overflow-wrap: anywhere; }

/* Tables. On a narrow screen each row becomes a stacked block and nothing is clipped. */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; font-size: 13px; color: var(--ba-slate); padding: 8px 10px; border-bottom: 1px solid var(--ba-mist); }
td { padding: 10px; border-bottom: 1px solid var(--ccz-line-soft); vertical-align: top; overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
caption { text-align: left; font-weight: 600; font-size: 16px; padding-bottom: var(--s2); }
@media (max-width: 719px) {
  table.stack-sm thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.stack-sm, table.stack-sm tbody, table.stack-sm tr, table.stack-sm td { display: block; width: 100%; }
  table.stack-sm tr { border-bottom: 1px solid var(--ba-mist); padding: var(--s2) 0; }
  table.stack-sm tr:last-child { border-bottom: 0; }
  table.stack-sm td { border: 0; padding: 3px 0; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; }
  table.stack-sm td::before { content: attr(data-label); font-weight: 600; font-size: 13px; color: var(--ba-slate); }
  table.stack-sm td:empty { display: none; }
}

/* Issue flow */
.steps { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--ba-slate); font-size: 14px; counter-reset: step; }
.steps li { display: inline-flex; align-items: center; gap: 6px; counter-increment: step; }
.steps li::before { content: counter(step); width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--ccz-field); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.steps li.done::before { background: var(--ccz-ok-bg); border-color: var(--ccz-ok); color: var(--ccz-ok); }
.steps li[aria-current="step"] { color: var(--ba-blue); font-weight: 700; }
.steps li[aria-current="step"]::before { background: var(--ba-blue); border-color: var(--ba-blue); color: var(--ccz-white); }
.preview { width: 100%; height: 70vh; min-height: 420px; border: 1px solid var(--ba-mist); background: var(--ccz-white); }
.accts { display: flex; flex-direction: column; gap: var(--s2); }

/* Coming soon and setup pages */
.center { flex: 1; display: flex; align-items: center; justify-content: center; padding: var(--s4); }
.soon { background: var(--ccz-white); border: 1px solid var(--ba-mist); border-radius: 12px; max-width: 560px; width: 100%; padding: 40px 32px; text-align: center; }
.soon .mark { width: 56px; height: 56px; margin: 0 auto 20px; color: var(--ba-blue); display: block; }
.soon .tag { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ba-blue); border: 1px solid var(--ba-blue); border-radius: 999px; padding: 4px 12px; margin-bottom: 16px; }
.soon h1 { font-size: 28px; line-height: 36px; margin-bottom: 12px; }
.soon p { font-size: 16px; line-height: 24px; color: var(--ba-slate); }
.soon footer { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--ba-mist); font-size: 12px; line-height: 16px; color: var(--ba-slate); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Demo area: the label on every page, and the passcode step. */
.demo-banner { background: var(--ccz-note-bg); color: var(--ccz-note); border-bottom: 1px solid var(--ccz-note); padding: var(--s2) var(--s4); font-size: 14px; text-align: center; }
.soon .gate { text-align: left; margin-top: var(--s4); }
.soon .msg { margin-top: var(--s3); text-align: left; }
input[type="password"] { display: block; width: 100%; padding: 9px 10px; min-height: 40px; border: 1px solid var(--ccz-field); border-radius: var(--ba-radius); background: var(--ccz-white); color: var(--ba-ink); font: inherit; }
/* Sign-in screens sit in a card, as in the design. */
.card.signin { padding: var(--s5); gap: var(--s4); }
/* Text for screen readers only: it tells apart links that read the same on screen. */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.pill { white-space: nowrap; }
.readbox.pre { white-space: pre-wrap; }
.readbox.mono { font-size: 13px; }
@media (min-width: 860px) { .card.sticky { position: sticky; top: var(--s4); } }
