/* International Institute of Applied AI Technology
   Engraved-credential look: cool paper, navy ink, verdigris and brass line-work. */

:root {
  --ink: #16213e;
  --ink-soft: #46516d;
  --paper: #f3f5f8;
  --sheet: #ffffff;
  --rule: #d4dae3;
  --seal: #2b6c62;
  --seal-deep: #1f5149;
  --brass: #a5803a;
  --alert: #9b2c2c;
  --alert-bg: #fbeeee;
  --ok-bg: #e9f3f0;

  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", "Segoe UI", system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: 2rem;
  --step-4: clamp(2.25rem, 4.2vw, 3.25rem);

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--sans);
}
img, svg { max-width: 100%; }
a { color: var(--seal-deep); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap.narrow { max-width: 46rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* ---------- rosette line-work ---------- */
svg[class*="seal"], .rosette, .cert-ground { overflow: visible; }
svg path, svg circle { fill: none; vector-effect: non-scaling-stroke; }
svg .r0 { stroke: var(--seal); stroke-width: .7px; }
svg .r1 { stroke: var(--brass); stroke-width: .6px; }
svg .r2 { stroke: var(--ink); stroke-width: .5px; opacity: .55; }
svg .rc { stroke: var(--seal); stroke-width: 1.2px; }

/* ---------- masthead ---------- */
.masthead { background: var(--sheet); border-bottom: 1px solid var(--rule); }
.masthead-in { display: flex; align-items: center; gap: 1.5rem; min-height: 5.25rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .85rem; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand-seal { width: 3rem; height: 3rem; flex: none; }
.brand-name { font-family: var(--serif); font-size: 1.05rem; line-height: 1.2; font-weight: 500; display: block; }
.sitenav { display: flex; gap: .25rem 1.5rem; flex-wrap: wrap; }
.sitenav a { color: var(--ink-soft); text-decoration: none; font-size: .95rem; font-weight: 500; padding: .35rem 0; border-bottom: 2px solid transparent; }
.sitenav a:hover { color: var(--ink); }
.sitenav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--seal); }
.nav-toggle { display: none; }

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.btn {
  display: inline-block; font: 600 .975rem/1 var(--sans); padding: .95rem 1.4rem;
  border-radius: 3px; text-decoration: none; cursor: pointer; border: 1px solid transparent;
}
.btn-primary { background: var(--seal-deep); color: #fff; }
.btn-primary:hover { background: var(--ink); color: #fff; }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-quiet:hover { background: var(--ink); color: #fff; }
.link-btn { background: none; border: 0; color: var(--seal-deep); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

/* ---------- hero ---------- */
.hero { padding: clamp(3rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 5rem); }
.hero-in { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.hero h1 { font-size: var(--step-4); max-width: 17ch; }
.lede { font-size: var(--step-1); color: var(--ink-soft); max-width: 38em; line-height: 1.55; }

.specimen { margin: 0; }
.specimen-sheet {
  position: relative; background: var(--sheet); padding: 2.75rem 2rem 2.25rem; text-align: center;
  box-shadow: 0 1px 0 var(--rule), 0 18px 40px -22px rgba(22, 33, 62, .35);
  aspect-ratio: 1.3 / 1; display: flex; flex-direction: column; justify-content: center; overflow: hidden;
}
.specimen-border {
  position: absolute; inset: .8rem; border: 1px solid var(--brass);
  box-shadow: inset 0 0 0 4px var(--sheet), inset 0 0 0 5px var(--seal);
  pointer-events: none;
}
.specimen-seal { position: absolute; width: 62%; left: 50%; top: 50%; transform: translate(-50%, -50%); opacity: .22; }
.specimen-sheet p { position: relative; margin: 0; }
.specimen-org { font-family: var(--serif); font-size: .95rem; letter-spacing: .02em; color: var(--seal-deep); margin-bottom: .9rem !important; }
.specimen-certifies { font-family: var(--serif); font-style: italic; color: var(--ink-soft); font-size: .9rem; }
.specimen-name { font-family: var(--serif); font-size: 1.6rem; margin: .2rem 0 .5rem !important; border-bottom: 1px solid var(--rule); padding-bottom: .3rem; align-self: center; min-width: 60%; color: var(--ink-soft); }
.specimen-title { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; line-height: 1.25; margin-top: .3rem !important; }
.specimen-id { font-size: .75rem; color: var(--ink-soft); margin-top: 1rem !important; font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.specimen figcaption { font-size: var(--step--1); color: var(--ink-soft); margin-top: 1rem; }

@media (prefers-reduced-motion: no-preference) {
  .specimen-seal path { stroke-dasharray: 4000; stroke-dashoffset: 4000; animation: engrave 3.2s ease-out .2s forwards; }
  .specimen-seal .r1 { animation-delay: .6s; }
  .specimen-seal .r2 { animation-delay: 1s; }
  @keyframes engrave { to { stroke-dashoffset: 0; } }
  .register-row .row-seal { transition: transform .9s cubic-bezier(.2,.7,.2,1); }
  .register-row > a:hover .row-seal { transform: rotate(40deg); }
}

/* ---------- sections ---------- */
.band { background: var(--sheet); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-title { font-size: var(--step-3); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.section-head p { color: var(--ink-soft); margin: 0; }

.steps { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; counter-reset: step; }
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 1rem; }
.steps li::before { content: counter(step); font-family: var(--serif); font-size: 2.25rem; line-height: 1; color: var(--seal); display: block; margin-bottom: .6rem; }
.steps h3 { font-size: var(--step-1); }
.steps p { color: var(--ink-soft); font-size: .975rem; margin: 0; }

/* ---------- the register of certifications ---------- */
.register-section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.register { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.register-row { border-bottom: 1px solid var(--rule); }
.register-row > a {
  display: grid; grid-template-columns: 5.5rem 1fr 11rem; gap: 1.75rem; align-items: center;
  padding: 1.6rem .5rem; text-decoration: none; color: var(--ink);
}
.register-row > a:hover { background: var(--sheet); }
.row-seal { width: 5.5rem; height: 5.5rem; }
.row-main { display: block; }
.row-code { display: inline-block; font-size: .8rem; font-weight: 600; color: var(--seal-deep); border: 1px solid var(--seal); border-radius: 2px; padding: .1rem .45rem; letter-spacing: .04em; margin-bottom: .45rem; }
.row-title { display: block; font-family: var(--serif); font-size: var(--step-2); line-height: 1.2; margin-bottom: .35rem; }
.row-sum { display: block; color: var(--ink-soft); font-size: .975rem; max-width: 46em; }
.row-facts { display: grid; gap: .2rem; font-size: .9rem; color: var(--ink-soft); }
.row-facts b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- verify ---------- */
.verify-in { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: end; }
.verify-in p { color: var(--ink-soft); max-width: 34em; }
.verify-form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.inline-field { display: flex; gap: .5rem; }
.inline-field input { flex: 1; min-width: 0; }

input, select, textarea {
  font: inherit; color: var(--ink); background: var(--sheet);
  border: 1px solid #aeb7c5; border-radius: 3px; padding: .8rem .9rem; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--seal); outline: 2px solid var(--seal); outline-offset: 0; }

/* ---------- inner pages ---------- */
.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 1.5rem; }
.page-head h1 { font-size: var(--step-4); }
.crumbs { font-size: var(--step--1); color: var(--ink-soft); margin-bottom: 1rem; }
.crumbs a { color: var(--ink-soft); }
.prose-section { padding: 1rem 0 clamp(3rem, 6vw, 5rem); }
.prose { font-size: 1.075rem; }
.prose h2 { font-size: var(--step-2); margin-top: 2rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }

.timeline { list-style: none; padding: 0; margin: 0 0 2rem; counter-reset: t; }
.timeline li { counter-increment: t; position: relative; padding: 0 0 1.75rem 3.5rem; border-left: 1px solid var(--rule); margin-left: 1.1rem; }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before {
  content: counter(t); position: absolute; left: -1.15rem; top: -.2rem; width: 2.3rem; height: 2.3rem; border-radius: 50%;
  background: var(--sheet); border: 1px solid var(--seal); color: var(--seal-deep);
  display: grid; place-items: center; font-family: var(--serif); font-size: 1.1rem;
}
.timeline h2 { margin-top: 0; font-size: var(--step-1); }

/* ---------- program page ---------- */
.program-head { background: var(--sheet); border-bottom: 1px solid var(--rule); padding: clamp(2.5rem, 6vw, 4rem) 0; overflow: hidden; }
.program-head-in { display: grid; grid-template-columns: 1fr 16rem; gap: 3rem; align-items: center; }
.program-head h1 { font-size: var(--step-4); max-width: 20ch; }
.program-seal { width: 16rem; height: 16rem; }
.code-line { color: var(--ink-soft); font-size: .95rem; }
.code-chip { display: inline-block; font-weight: 600; color: var(--seal-deep); border: 1px solid var(--seal); border-radius: 2px; padding: .05rem .5rem; margin-left: .3rem; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.code-chip.big { font-size: 1.15rem; padding: .25rem .7rem; }

.program-body { padding: clamp(2.5rem, 6vw, 4rem) 0; }
.program-grid { display: grid; grid-template-columns: 1fr 20rem; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.program-main h2 { font-size: var(--step-3); margin-top: .5rem; }
.outcomes { padding: 0; list-style: none; margin: 0 0 3rem; display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 2rem; }
.outcomes li { padding-left: 1.5rem; position: relative; }
.outcomes li::before { content: ""; position: absolute; left: 0; top: .55em; width: .6rem; height: .6rem; border: 1.5px solid var(--seal); transform: rotate(45deg); }

.modules { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--ink); }
.module { border-bottom: 1px solid var(--rule); }
.module summary { cursor: pointer; list-style: none; display: flex; gap: 1rem; align-items: baseline; padding: 1.1rem 0; }
.module summary::-webkit-details-marker { display: none; }
.module summary::after { content: "+"; margin-left: auto; font-size: 1.4rem; line-height: 1; color: var(--seal); }
.module details[open] summary::after { content: "\2212"; }
.module-n { font-family: var(--serif); color: var(--seal); font-size: 1.35rem; min-width: 1.5rem; }
.module-t { font-family: var(--serif); font-size: var(--step-1); font-weight: 500; }
.module-body { padding: 0 0 1.4rem 2.5rem; }
.module-body ul { padding-left: 1.1rem; margin: 0 0 1rem; }
.module-body li { margin-bottom: .25rem; }
.exercise { background: var(--paper); border-left: 3px solid var(--brass); padding: .8rem 1rem; margin: 0; font-size: .975rem; }

.program-side { position: sticky; top: 1.5rem; background: var(--sheet); border: 1px solid var(--rule); padding: 1.5rem; }
.facts { margin: 0; }
.facts > div { padding: .8rem 0; border-bottom: 1px solid var(--rule); }
.facts > div:first-child { padding-top: 0; }
.facts dt { font-weight: 600; font-size: .85rem; color: var(--ink-soft); margin-bottom: .2rem; }
.facts dd { margin: 0; font-size: .975rem; }
.facts.compact > div { display: flex; justify-content: space-between; gap: 1rem; }
.side-note { font-size: .9rem; margin: 1rem 0 0; color: var(--ink-soft); }

/* ---------- forms & alerts ---------- */
.form-card { background: var(--sheet); border: 1px solid var(--rule); padding: clamp(1.25rem, 4vw, 2rem); margin-bottom: 3rem; }
.narrow-form { max-width: 26rem; }
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.hint { font-size: .875rem; color: var(--ink-soft); margin: .35rem 0 0; }
.check { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: 1.5rem; }
.check input { width: auto; margin-top: .3rem; }
.alert { background: var(--alert-bg); border-left: 3px solid var(--alert); padding: .9rem 1.1rem; margin-bottom: 1.5rem; color: #5c1a1a; }
.alert p:last-child { margin: 0; }
.alert.ok { background: var(--ok-bg); border-left-color: var(--seal); color: var(--ink); }
.trap { position: absolute; left: -9999px; }
.plain-list { padding-left: 1.2rem; }

/* ---------- exam ---------- */
.exam-section { padding: 0 0 4rem; }
.exam-intro { margin-bottom: 2rem; }
.exam-bar {
  position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: var(--ink); color: #fff; padding: .9rem 1.2rem; margin-bottom: 2rem; font-size: .95rem;
}
.exam-bar strong { font-variant-numeric: tabular-nums; }
.exam-bar.low { background: var(--alert); }
.question { border: 0; border-top: 1px solid var(--rule); padding: 1.5rem 0; margin: 0; }
.question legend { font-family: var(--serif); font-size: var(--step-1); line-height: 1.4; padding: 0; margin-bottom: 1rem; }
.q-n { display: block; font-family: var(--sans); font-size: .825rem; color: var(--ink-soft); font-weight: 600; margin-bottom: .35rem; }
.option { display: flex; gap: .75rem; align-items: flex-start; padding: .7rem .9rem; border: 1px solid var(--rule); background: var(--sheet); margin-bottom: .5rem; cursor: pointer; border-radius: 3px; }
.option:hover { border-color: var(--seal); }
.option input { width: auto; margin-top: .3rem; accent-color: var(--seal-deep); }
.option:has(input:checked) { border-color: var(--seal-deep); background: var(--ok-bg); }
.exam-submit { border-top: 1px solid var(--ink); padding-top: 1.5rem; }

/* ---------- result ---------- */
.result { padding: clamp(3rem, 7vw, 5rem) 0; text-align: center; }
.result .lede { margin-left: auto; margin-right: auto; }
.result .actions { justify-content: center; }
.result-seal { width: 11rem; height: 11rem; margin-bottom: 1.5rem; }
.result h1 { font-size: var(--step-4); }
.score { font-size: var(--step-1); font-weight: 600; }
.cred-number { margin-top: 1.5rem; }

/* ---------- verify result ---------- */
.verify-result { padding: 0 0 4rem; }
.verdict { background: var(--sheet); border: 1px solid var(--rule); border-top: 4px solid var(--seal); padding: 1.75rem; display: grid; grid-template-columns: 7rem 1fr; gap: 1.75rem; align-items: start; }
.verdict.lapsed { border-top-color: var(--brass); }
.verdict.none { border-top-color: var(--alert); display: block; }
.verdict-seal { width: 7rem; height: 7rem; }
.verdict-state { font-weight: 700; color: var(--seal-deep); margin-bottom: .4rem; }
.verdict.lapsed .verdict-state { color: #7a5b1e; }
.verdict.none .verdict-state { color: var(--alert); }
.verdict h2 { font-size: var(--step-3); margin-bottom: .2rem; }

/* ---------- admin ---------- */
.admin { padding: 0 0 4rem; }
.tabs { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--rule); margin-bottom: 1.5rem; flex-wrap: wrap; }
.tabs a { text-decoration: none; color: var(--ink-soft); padding: .6rem 0; border-bottom: 2px solid transparent; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--seal); }
.table-wrap { overflow-x: auto; background: var(--sheet); border: 1px solid var(--rule); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th { font-weight: 600; background: var(--paper); }
tr.revoked td { color: #999; text-decoration: line-through; }
tr.revoked td:last-child { text-decoration: none; }
.message { background: var(--sheet); border: 1px solid var(--rule); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.message-meta { font-size: .875rem; color: var(--ink-soft); }

/* ---------- footer ---------- */
.colophon { background: var(--ink); color: #c9d0de; margin-top: 0; padding: 3.5rem 0 1.5rem; font-size: .95rem; }
.colophon a { color: #fff; text-decoration: none; }
.colophon a:hover { text-decoration: underline; }
.colophon-in { display: grid; grid-template-columns: 1fr 1.6fr; gap: 3rem; }
.colophon-brand { display: flex; gap: 1rem; align-items: flex-start; }
.colophon-brand strong { color: #fff; font-family: var(--serif); font-weight: 500; font-size: 1.1rem; }
.colophon-seal { width: 4rem; height: 4rem; flex: none; }
.colophon-seal .r0, .colophon-seal .rc { stroke: #7fb7ad; }
.colophon-seal .r1 { stroke: #d2b06b; }
.colophon-seal .r2 { stroke: #fff; }
.colophon-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.colophon h2 { font-family: var(--sans); font-size: .85rem; font-weight: 600; color: #fff; margin-bottom: .8rem; }
.colophon ul { list-style: none; padding: 0; margin: 0; }
.colophon li { margin-bottom: .35rem; }
.colophon-base { border-top: 1px solid #2f3b5a; margin-top: 2.5rem; padding-top: 1.25rem; font-size: .825rem; color: #97a1b8; }
.colophon-base p { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero-in, .verify-in, .program-grid, .colophon-in { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .program-head-in { grid-template-columns: 1fr; }
  .program-seal { display: none; }
  .program-side { position: static; }
  .specimen { max-width: 34rem; }
}
@media (max-width: 720px) {
  .nav-toggle {
    display: inline-block; background: none; border: 1px solid var(--ink); color: var(--ink);
    font: 600 .9rem var(--sans); padding: .5rem .9rem; border-radius: 3px; cursor: pointer;
  }
  .sitenav { display: none; width: 100%; flex-direction: column; padding-bottom: 1rem; }
  .sitenav.open { display: flex; }
  .sitenav a { padding: .6rem 0; border-bottom: 1px solid var(--rule); }
  .brand-name { font-size: .95rem; }
  .register-row > a { grid-template-columns: 3.5rem 1fr; gap: 1rem; align-items: start; }
  .row-seal { width: 3.5rem; height: 3.5rem; }
  .row-facts { grid-column: 2; display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
  .outcomes { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .colophon-cols { grid-template-columns: 1fr 1fr; }
  .verdict { grid-template-columns: 1fr; }
  .module-body { padding-left: 0; }
  .inline-field { flex-direction: column; }
  .specimen-sheet { padding: 2rem 1.25rem; }
  .specimen-title { font-size: 1.05rem; }
  .specimen-name { font-size: 1.25rem; }
}

/* ---------- accounts and admin forms ---------- */
.admin-form { max-width: 52rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
fieldset.checks { border: 0; padding: 0; margin: 0 0 1.2rem; }
fieldset.checks legend { font-weight: 600; font-size: .9rem; margin-bottom: .5rem; padding: 0; }
fieldset.checks .check { margin-bottom: .4rem; font-weight: 400; font-size: .975rem; display: flex; }
.admin .section-title { font-size: var(--step-2); margin-top: 2rem; }
.copy-link input { font-size: .9rem; background: var(--sheet); }
.row-actions { display: flex; gap: 1rem; align-items: center; }
.row-actions form { margin: 0; }
.account-item { display: grid; grid-template-columns: 5.5rem 1fr auto; gap: 1.75rem; align-items: center; padding: 1.4rem .5rem; }
.account-item .row-title { color: var(--ink); text-decoration: none; }
.account-item .row-title:hover { text-decoration: underline; }
.account-actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }
.account-actions .btn { padding: .75rem 1.1rem; }
@media (max-width: 720px) {
  .field-row { grid-template-columns: 1fr; }
  .account-item { grid-template-columns: 3.5rem 1fr; gap: 1rem; }
  .account-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
fieldset.signer { border: 1px solid var(--rule); padding: 1rem 1.25rem .25rem; margin: 0 0 1.5rem; }
fieldset.signer legend { font-weight: 600; padding: 0 .4rem; }
fieldset.signer .check { font-weight: 400; display: flex; margin-bottom: .3rem; }
.sig-current img { display: block; max-height: 60px; max-width: 260px; margin-top: .4rem; background: #fff; border: 1px solid var(--rule); padding: 4px; }
