/* Small refinements to the approved CIP layout, without changing its structure. */
:root {
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --detail-width: 960px;
}

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.icon { display: inline-block; width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.btn .icon, .back-link .icon { width: 18px; height: 18px; }
.audience-item .symbol { width: 25px; height: 25px; }
@media (min-width: 901px) {
  .audience-item { padding-block: 30px; }
}
.topic-link .icon { margin-left: 3px; width: 18px; height: 18px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; }
.detail-page .container { max-width: var(--detail-width); }
.detail-hero h1, .detail-hero .lead { max-width: none; }
.detail-content { overflow-wrap: anywhere; }

h1, h2, h3 { letter-spacing: -.035em; text-wrap: balance; }
h2, h3 { line-height: 1.18; }
p, li { text-wrap: pretty; }
.topic h3 { letter-spacing: -.025em; }
.topic-number { letter-spacing: -.04em; }
.metric strong, .topic-number, .step .num { font-family: 'Public Sans', Arial, sans-serif; }

.btn {
  min-height: 44px;
  background: var(--pink);
  transition: background-color 180ms ease, transform 180ms var(--ease-out);
}
.btn:hover { background: #db008e; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { transform: none; }
.btn.blue:hover { background: var(--deep); }
.btn.outline:hover { background: #ffffff12; }
.nav a:not(.btn):hover { color: var(--pink); }
.nav .btn:hover { color: white; }
.nav a:not(.btn) { padding-block: 12px; }

.topic {
  transition: border-color 180ms ease, transform 220ms var(--ease-out);
}
.topic:hover { box-shadow: none; border-color: var(--blue); transform: translateY(-4px); }
.topic:focus-within { border-color: var(--blue); }
.fund { color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1.45; }
.topic-link { padding-block: 5px; text-underline-offset: 4px; }
.topic-link:hover { color: var(--blue); }
.topic-link .link-arrow { display: inline-block; transition: transform 220ms var(--ease-out); }
.topic-link:hover .link-arrow, .topic-link:focus-visible .link-arrow { transform: translate(3px, -3px); }

.step { position: relative; border-top: 0; padding-top: 26px; }
.step::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--pink);
  transform: scaleX(var(--line-progress, 1));
  transform-origin: left;
}
.step .num { line-height: 1; }
.step h3 { min-height: 0; margin: 11px 0 7px; }
.step .date { min-height: 0; line-height: 1.4; }
.step p { margin: 10px 0 0; }
.back-link, .footer-links a { text-underline-offset: 4px; }
.footer-links a { padding-block: 10px; }
.contact .btn { flex-shrink: 0; }

.field { margin: 22px 0; }
.field label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.input-wrap { position: relative; }
.input-wrap > .icon { position: absolute; top: 16px; left: 14px; color: var(--muted); pointer-events: none; }
.field input {
  margin-top: 0;
  padding: 14px 14px 14px 44px;
  min-height: 52px;
  border-radius: 6px;
  line-height: 1.4;
  font-weight: 400;
  font-size: 16px;
  background: white;
  color: var(--ink);
  outline: none;
  box-shadow: none;
  transition: none;
}
.field input::placeholder { color: var(--muted); opacity: 1; }
.field input:focus, .field input:focus-visible { outline: none; box-shadow: none; }
.field input[aria-invalid="true"] { border-color: var(--pink); border-width: 2px; padding: 13px 13px 13px 43px; }
.field-error { margin-top: 7px; font-size: 12px; font-weight: 400; line-height: 1.5; }
.field-error { display: flex; align-items: flex-start; gap: 6px; color: var(--ink); }
.field-error .icon { width: 16px; height: 16px; margin-top: 1px; color: var(--pink); }
.field-error[hidden] { display: none; }
.form-submit { margin-top: 5px; min-height: 52px; }
.form-submit .submit-spinner { display: none; }
.form-submit[aria-busy="true"] .submit-spinner { display: inline-block; animation: icon-spin 900ms linear infinite; }
.form-submit[aria-busy="true"] .submit-icon { display: none; }
@keyframes icon-spin { to { transform: rotate(360deg); } }
.checklist { list-style: none; counter-reset: application-step; padding: 0; margin: 28px 0 22px; }
.checklist li { position: relative; counter-increment: application-step; padding: 4px 0 4px 54px; margin: 20px 0; min-height: 38px; }
.checklist li::before { content: counter(application-step, decimal-leading-zero); position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: var(--pink); color: white; font: 800 20px/1 'Public Sans', Arial, sans-serif; }
.fineprint { font-size: 12px !important; }
#form-status:empty { display: none; }
#form-status:not(:empty) {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 3px;
  background: var(--ice);
  color: var(--ink);
}
#form-status > .icon { margin-top: 1px; }
#form-status[data-state="error"] { border: 1px solid var(--pink); background: white; }
.downloads-reopen { margin-top: 18px; }
.downloads-reopen[hidden] { display: none; }

/* A separate, quiet download view; the full first pages stay uncropped. */
html.downloads-open { overflow: hidden; }
.download-dialog {
  width: min(1120px, calc(100% - 40px));
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 52px 40px 24px;
  border: 0;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
}
.download-dialog::backdrop { background: #152047b3; }
.download-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.download-close:hover { color: var(--blue); background: var(--ice); }
.download-close .icon { width: 24px; height: 24px; }
.download-heading { text-align: center; }
.download-heading h2 { margin: 0; font-size: clamp(22px, 3.5vw, 38px); overflow-wrap: break-word; hyphens: auto; }
.download-heading h2:focus { outline: none; }
.download-heading p { max-width: 52ch; margin: 14px auto 22px; font-size: 15px; color: var(--muted); }
.download-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 36px; }
.download-card { display: block; min-width: 0; color: var(--ink); text-decoration: none; border-radius: 4px; }
.download-visual {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  padding: 10px;
  overflow: hidden;
  background: var(--ice);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.download-visual img { width: 100%; height: 100%; min-height: 0; object-fit: contain; filter: saturate(.25); }
.download-visual::after { content: ''; position: absolute; inset: 0; background: #1a349b26; transition: background-color 180ms ease; }
.download-action {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 94px;
  height: 102px;
  border-radius: 6px;
  background: white;
  color: var(--blue);
  box-shadow: 0 4px 20px #15204714;
  font-size: 12px;
  font-weight: 700;
  transition: transform 220ms var(--ease-out);
}
.download-action .icon { width: 36px; height: 36px; stroke-width: 1.5; }
.download-title { display: block; margin-top: 13px; font-size: 14px; font-weight: 700; line-height: 1.45; hyphens: auto; }
.download-card:hover .download-visual::after, .download-card:focus-visible .download-visual::after { background: #1a349b12; }
.download-card:hover .download-action { transform: translateY(-3px); }
.download-card[aria-disabled="true"] { cursor: wait; }
.download-card[aria-busy="true"] .download-action { opacity: .65; transform: none; }
.download-status { margin: 20px 0 0; min-height: 22px; text-align: center; font-size: 13px; color: var(--muted); }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.hero :focus-visible, .register :focus-visible, .footer :focus-visible {
  outline-color: white;
}
.register-form :focus-visible { outline-color: var(--blue); }

/* Original document covers overlap from back-left to front-right inside the form. */
.register-form { padding-bottom: 0; overflow: hidden; }
.document-previews {
  position: relative;
  isolation: isolate;
  aspect-ratio: 100 / 23;
  margin-top: 32px;
}
.document-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 46%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  box-shadow: -6px 0 16px #15204724;
  z-index: 1;
}
.document-preview:nth-child(2) { left: 18%; z-index: 2; }
.document-preview:nth-child(3) { left: 36%; z-index: 3; }
.document-preview:nth-child(4) { left: 54%; z-index: 4; }
.document-preview img { display: block; width: 100%; height: auto; }

@media (max-width: 900px) {
  .process { column-gap: 20px; row-gap: 30px; }
  .download-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .process { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(40px, 9.5vw, 60px); }
  .detail-hero h1 { font-size: clamp(32px, 7.5vw, 42px); }
  .hero-actions { gap: 12px; }
  .hero-actions .btn { min-height: 48px; }
  .contact-grid > .btn { margin-top: 12px; }
  .step h3 { overflow-wrap: anywhere; }
  .footer-links { flex-wrap: wrap; gap: 8px 24px; }
  .document-previews { margin-top: 28px; }
  .download-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); padding: 56px 20px 16px; }
  .download-grid { gap: 22px 14px; margin-top: 28px; }
  .download-action { width: 76px; height: 86px; }
  .download-action .icon { width: 30px; height: 30px; }
  .download-title { font-size: 12px; overflow-wrap: anywhere; }
}
@media (max-width: 380px) {
  .hero-actions .btn { width: 100%; }
}
@media (hover: none) {
  .btn:hover, .topic:hover, .download-card:hover .download-action { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .btn:hover, .btn:active, .topic:hover, .download-card:hover .download-action { transform: none; }
  .topic-link .link-arrow { transform: none !important; }
}
