:root {
  --ink: #1d2433; --muted: #5b6475; --line: #d9dde5; --bg: #f5f6f8; --card: #fff;
  --brand: #0e47a1; --brand-dark: #0a3478; --accent: #f4ad0d; --err: #b3261e; --ok: #1e7b45;
  --radius: 8px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }
header.site { background: var(--brand); color: #fff; padding: 36px 0 32px; border-bottom: 4px solid var(--accent); }
header.site h1 { margin: 4px 0 8px; font-size: 1.9rem; line-height: 1.2; }
header.site .lead { margin: 0; opacity: .9; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 600; opacity: .85; }
main.wrap { padding-top: 28px; padding-bottom: 60px; }
footer.site { border-top: 1px solid var(--line); padding: 20px 0; color: var(--muted); font-size: .9rem; }

.intro, .step, .notice, .panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; margin-bottom: 20px; }
.intro ul { padding-left: 20px; }
.notice { border-left: 4px solid var(--accent); }
.error-summary { border-left-color: var(--err); }
.error-summary strong { color: var(--err); }

h2 { margin: 0 0 6px; font-size: 1.35rem; }
h2:focus { outline: none; }
.hint { color: var(--muted); font-size: .9rem; margin: 4px 0 10px; }
.field { margin: 18px 0; border: 0; padding: 0; }
fieldset.field { min-width: 0; }
label, legend { display: block; font-weight: 600; margin-bottom: 6px; }
legend { padding: 0; }
.req { color: var(--err); font-weight: 400; }
input[type=text], input[type=email], input[type=url], input[type=tel], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #b9c0cc; border-radius: 6px; font: inherit; background: #fff; color: inherit;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid rgba(14,71,161,.3); border-color: var(--brand); }
[aria-invalid="true"], fieldset.invalid { border-color: var(--err) !important; }
fieldset.invalid legend { color: var(--err); }
.error { color: var(--err); font-size: .9rem; margin: 6px 0 0; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid2 .field { margin: 12px 0; }
.checks label { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; }
.checks.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.checks.inline { display: flex; gap: 22px; flex-wrap: wrap; }
.check { font-weight: 400 !important; display: flex !important; gap: 10px; align-items: flex-start; margin: 10px 0; }
.checks input, .check input { margin-top: 5px; flex: none; }
.card-option { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; }
.card-option:has(input:checked) { border-color: var(--brand); background: #eef3fb; }
.upload input[type=file] { display: block; padding: 10px; border: 1px dashed #b9c0cc; border-radius: 6px; width: 100%; background: #fafbfc; }
.hp { position: absolute; left: -9999px; }

.btn { font: inherit; font-weight: 600; padding: 11px 22px; border-radius: 6px; border: 1px solid #b9c0cc; background: #fff; color: var(--ink); cursor: pointer; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .6; cursor: wait; }
.step-buttons { display: none; }

/* Step mode (only with JavaScript) */
.steps-nav { display: none; }
body.js .steps-nav { display: flex; list-style: none; padding: 0; margin: 0 0 18px; gap: 6px; counter-reset: s; flex-wrap: wrap; }
body.js .steps-nav li { counter-increment: s; flex: 1; min-width: 90px; font-size: .8rem; color: var(--muted); border-top: 4px solid var(--line); padding-top: 6px; }
body.js .steps-nav li::before { content: counter(s) ". "; }
body.js .steps-nav li.done { border-color: var(--ok); }
body.js .steps-nav li.current { border-color: var(--brand); color: var(--ink); font-weight: 600; }
body.js .step { display: none; }
body.js .step.active { display: block; }
body.js .step-buttons { display: flex; justify-content: space-between; }
body.js .step-buttons #next-btn { margin-left: auto; }
[hidden] { display: none !important; }

/* Admin */
table { width: 100%; border-collapse: collapse; background: #fff; font-size: .92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #eef1f5; font-weight: 600; }
.tag { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: #fdf1d0; color: #7a5800; margin: 1px 2px 1px 0; }
.tag.over { background: #fbe0de; color: var(--err); }
.tag.okk { background: #ddf1e5; color: var(--ok); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.toolbar select { width: auto; }
dl.detail { display: grid; grid-template-columns: 260px 1fr; gap: 6px 18px; margin: 0; }
dl.detail dt { font-weight: 600; color: var(--muted); }
dl.detail dd { margin: 0; white-space: pre-wrap; }
.wide { max-width: 1200px; }

@media (max-width: 640px) {
  .grid2, .checks.cols { grid-template-columns: 1fr; }
  dl.detail { grid-template-columns: 1fr; }
  header.site h1 { font-size: 1.5rem; }
  .intro, .step, .notice { padding: 18px; }
}
td:first-child a { white-space: nowrap; }

/* Save & resume */
.notice.ok { border-left-color: var(--ok); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.btn.ghost:hover { background: #eef3fb; }
body.js .step-buttons { gap: 10px; flex-wrap: wrap; align-items: center; }
.autosave-note { text-align: right; min-height: 1.4em; margin: 8px 0 0; }
.save-panel { background: var(--card); border: 2px solid var(--brand); border-radius: var(--radius); padding: 20px 24px; margin: 16px 0; }
.save-panel h3 { margin: 0 0 6px; font-size: 1.15rem; }
.save-panel label { margin-top: 12px; }
.save-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.save-msg { margin: 12px 0 0; font-weight: 600; }
.save-msg.ok { color: var(--ok); }
.save-msg.error { color: var(--err); }
.resend { margin: 12px 0; }
.resend summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.resend-body { padding: 10px 0 0; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input { flex: 1 1 220px; }
.file-list { list-style: none; padding: 0; margin: 0 0 8px; }
.file-list li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 12px; background: #eef6f0; border: 1px solid #cfe5d6; border-radius: 6px; margin-bottom: 6px; }
.file-list li::before { content: "✓"; color: var(--ok); font-weight: 700; }
.fname { font-weight: 600; overflow-wrap: anywhere; }
.fsize { color: var(--muted); font-size: .85rem; }
.link-btn { background: none; border: 0; padding: 4px; color: var(--brand); text-decoration: underline; cursor: pointer; font: inherit; margin-left: auto; }
.upload.invalid input[type=file] { border-color: var(--err); }
.upload.invalid .upload-status { color: var(--err); font-weight: 600; }
.upload-status:empty { display: none; }

/* Call criteria shown above the related questions */
.criterion { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 26px; }
.crit-text { margin: 0 0 10px; padding: 10px 14px; background: #f3f6fb; border-left: 3px solid var(--brand); border-radius: 0 6px 6px 0; font-size: .93rem; }
fieldset.yn { margin: 10px 0; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
fieldset.yn legend { float: left; margin: 0; min-width: 80px; }
fieldset.yn .error { flex-basis: 100%; }

/* Eligibility step: questions per criterion, then common questions */
.option-questions, .common-questions { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 6px; }
.option-questions h3, .common-questions h3 { margin: 16px 0 4px; font-size: 1.08rem; color: var(--brand); }
.common-questions .criterion:first-of-type { border-top: 0; margin-top: 8px; padding-top: 0; }

/* Live e-mail messages */
.live-msg { margin: 6px 0 0; font-size: .9rem; min-height: 0; }
.live-msg:empty { display: none; }
.live-msg.bad { color: var(--err); font-weight: 600; }
.live-msg.ok { color: var(--ok); font-weight: 600; }

/* Language switcher */
.site-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.langs { display: flex; gap: 4px; }
.langs a { color: #fff; text-decoration: none; font-size: .85rem; font-weight: 600; padding: 4px 9px; border: 1px solid rgba(255,255,255,.45); border-radius: 6px; min-width: 40px; text-align: center; }
.langs a:hover { background: rgba(255,255,255,.12); }
.langs a[aria-current="true"] { background: #fff; color: var(--brand); border-color: #fff; }
.check > span { flex: 1; }

/* Logo bar */
.brandbar{background:#fff;border-bottom:1px solid #e3e6ec}
.brandbar-in{display:flex;flex-wrap:wrap;align-items:center;gap:10px 20px;padding-top:12px;padding-bottom:12px}
.brand-pfd img{display:block;height:60px;width:auto}
.brand-ec{margin-left:auto}
.brand-ec img{display:block;height:52px;width:auto}
.langs-dark{display:flex;gap:4px}
.langs-dark a{color:#1d2433;text-decoration:none;font-size:13.5px;font-weight:600;padding:5px 10px;border:1px solid #c7cdd8;border-radius:6px;min-width:42px;text-align:center}
.langs-dark a:hover{border-color:#0e47a1;color:#0e47a1}
.langs-dark a[aria-current=true]{background:#0e47a1;border-color:#0e47a1;color:#fff}
@media (max-width:560px){.brand-pfd img{height:46px}.brand-ec img{height:40px}.langs-dark{width:100%;justify-content:flex-end}}
