/* LOMISAD design system
   Colour: navy ink on white and a cool grey ground. Green, amber and red appear only as readiness states.
   Type: Source Serif 4 for headings, Public Sans for reading and figures.
   No gradients anywhere. */

:root {
  --navy: #0F2A44;
  --navy-hover: #1A3B5C;
  --navy-soft: #E7EDF3;
  --ink: #13202C;
  --slate: #56677A;
  --line: #DCE2E8;
  --line-strong: #C3CDD7;
  --ground: #F2F4F6;
  --white: #FFFFFF;
  --green: #1E6B47;
  --green-soft: #E3F1EA;
  --amber: #8F5C0C;
  --amber-soft: #FBF0DD;
  --red: #A8321F;
  --red-soft: #FBE8E4;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", "Segoe UI", Roboto, Arial, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: 1.75rem;
  --step-4: 2.25rem;
  --step-5: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);

  --radius-s: 6px;
  --radius-m: 10px;
  --header-h: 72px;
  --wrap: 1180px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  font-feature-settings: "tnum" 1, "lnum" 1;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; color: var(--navy); margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: var(--step-5); letter-spacing: -0.02em; }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
p { margin: 0 0 1em; }
.lead { font-size: var(--step-1); color: var(--slate); max-width: 62ch; }
.muted { color: var(--slate); }
.small { font-size: var(--step--1); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: var(--radius-s); z-index: 200; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid #2E6CA8; outline-offset: 2px; border-radius: 2px; }

.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.section { padding-block: clamp(56px, 8vw, 104px); }
.section--ground { background: var(--ground); }
.section--navy { background: var(--navy); color: #DCE6F0; }
.section--navy h2, .section--navy h3 { color: #fff; }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head p { color: var(--slate); font-size: var(--step-1); }
.section--navy .section-head p { color: #C6D3E0; }

/* Buttons */
.btn {
  --bg: var(--navy); --fg: #fff; --bd: var(--navy);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border-radius: var(--radius-s);
  border: 1px solid var(--bd); background: var(--bg); color: var(--fg);
  font: 600 var(--step-0)/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.btn:hover { --bg: var(--navy-hover); --bd: var(--navy-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--ghost { --bg: transparent; --fg: var(--navy); --bd: var(--line-strong); }
.btn--ghost:hover { --bg: var(--navy-soft); --bd: var(--navy); }
.btn--light { --bg: #fff; --fg: var(--navy); --bd: #fff; }
.btn--light:hover { --bg: #E7EDF3; --bd: #E7EDF3; }
.btn--danger { --bg: var(--red); --bd: var(--red); }
.btn--danger:hover { --bg: #8C2817; --bd: #8C2817; }
.btn--sm { min-height: 36px; padding: 6px 14px; font-size: var(--step--1); }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .65; cursor: progress; }
.link-btn.is-busy { display: inline-flex; align-items: center; gap: 6px; cursor: progress; opacity: .7; }
.btn .spinner, .link-btn .spinner { display: inline-block; flex: none; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { background: none; border: 0; padding: 0; color: var(--navy); font: inherit; text-decoration: underline; cursor: pointer; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: #fff; border-bottom: 1px solid var(--line); }
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; height: 100%; text-decoration: none; margin-right: auto; }
.brand img { height: 56px; width: auto; }
@media (max-width: 420px) { .brand img { height: 48px; } }
.footer-logo { display: block; height: 53px; width: auto; margin-bottom: 18px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions .signin { font-weight: 600; text-decoration: none; padding: 8px 10px; }
.menu-toggle {
  width: 46px; height: 46px; display: inline-grid; place-items: center; border-radius: var(--radius-s);
  border: 1px solid var(--line-strong); background: #fff; cursor: pointer; color: var(--navy);
}
.menu-toggle:hover { border-color: var(--navy); }
.menu-toggle .bars { width: 20px; height: 14px; position: relative; }
.menu-toggle .bars span { position: absolute; left: 0; width: 100%; height: 2px; background: currentColor; border-radius: 2px; transition: transform .25s var(--ease), opacity .2s, top .25s var(--ease); }
.menu-toggle .bars span:nth-child(1) { top: 0; }
.menu-toggle .bars span:nth-child(2) { top: 6px; }
.menu-toggle .bars span:nth-child(3) { top: 12px; }
.menu-open .menu-toggle .bars span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.menu-open .menu-toggle .bars span:nth-child(2) { opacity: 0; }
.menu-open .menu-toggle .bars span:nth-child(3) { top: 6px; transform: rotate(-45deg); }
@media (max-width: 560px) { .header-actions .btn, .header-actions .signin { display: none; } }

/* Slide out menu */
.menu-scrim { position: fixed; inset: 0; background: rgba(15, 42, 68, .35); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 60; }
.menu-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: #fff; z-index: 70;
  transform: translateX(100%); transition: transform .3s var(--ease); display: flex; flex-direction: column;
  border-left: 1px solid var(--line); visibility: hidden;
}
.menu-open .menu-scrim { opacity: 1; pointer-events: auto; }
.menu-open .menu-panel { transform: none; visibility: visible; }
.menu-head { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--line); }
.menu-head strong { font-family: var(--serif); color: var(--navy); font-size: var(--step-1); }
.menu-body { overflow-y: auto; padding: 12px 20px 28px; flex: 1; }
.menu-group { padding: 16px 0; border-bottom: 1px solid var(--line); }
.menu-group:last-child { border-bottom: 0; }
.menu-group h2 { font-family: var(--sans); font-size: var(--step--1); color: var(--slate); font-weight: 600; margin: 0 0 6px; }
.menu-group a { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; text-decoration: none; font-size: var(--step-1); color: var(--ink); }
.menu-group a:hover { color: var(--navy); text-decoration: underline; }
.menu-group a[aria-current="page"] { color: var(--navy); font-weight: 600; }
.menu-group a small { color: var(--slate); font-size: var(--step--1); }
.menu-cta { display: grid; gap: 10px; padding-top: 18px; }
body.menu-open { overflow: hidden; }

/* Footer */
.site-footer { background: var(--ink); color: #B9C5D1; padding: 64px 0 28px; font-size: var(--step--1); }
.site-footer a { color: #E4EBF2; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer-grid h2 { font-family: var(--sans); font-size: var(--step--1); color: #fff; font-weight: 600; margin-bottom: 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-brand p { max-width: 36ch; }
.footer-legal { margin-top: 48px; padding-top: 20px; border-top: 1px solid #2A3A4A; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* Forms */
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label, .label { font-weight: 600; font-size: var(--step--1); color: var(--ink); }
.field .hint { font-size: var(--step--1); color: var(--slate); }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  background: #fff; color: var(--ink); font: inherit; transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 120px; resize: vertical; }
.input:hover { border-color: #9AA9B8; }
.input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(15, 42, 68, .14); }
.input[aria-invalid="true"] { border-color: var(--red); }
.field-error { color: var(--red); font-size: var(--step--1); min-height: 0; }
.email-hint { margin: 2px 0 0; padding: 8px 12px; border: 1px solid #EBCF9E; border-radius: var(--radius-s); background: var(--amber-soft); color: #5E3C06; font-size: var(--step--1); line-height: 1.5; }
.email-hint .link-btn { font-weight: 600; color: #5E3C06; }
.email-hint .link-btn.muted { font-weight: 400; margin-left: 4px; }
.email-hint.shake { animation: hint-shake .4s; }
@keyframes hint-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .email-hint.shake { animation: none; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--step--1); }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--navy); flex: none; }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 52px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 38px;
  border: 0; background: transparent; color: var(--slate); cursor: pointer; border-radius: var(--radius-s); display: grid; place-items: center;
}
.pw-toggle:hover { color: var(--navy); background: var(--ground); }
.pw-meter { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.pw-meter span { display: block; height: 100%; width: 0; background: var(--red); transition: width .25s, background-color .25s; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 620px) { .form-row { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -9999px; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--slate); font-size: var(--step--1); margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Notices */
.notice { padding: 12px 14px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--ground); font-size: var(--step--1); margin-bottom: 16px; }
.notice--error { background: var(--red-soft); border-color: #F0C2B8; color: #6F1F12; }
.notice--ok { background: var(--green-soft); border-color: #B9DCC9; color: #134A31; }
.notice--warn { background: var(--amber-soft); border-color: #EBCF9E; color: #5E3C06; }
.notice[hidden] { display: none; }

/* Toasts */
.toasts { position: fixed; z-index: 120; right: 16px; bottom: 16px; display: grid; gap: 10px; width: min(380px, calc(100% - 32px)); }
.toast { background: var(--ink); color: #fff; border-radius: var(--radius-s); padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; animation: toast-in .25s var(--ease); font-size: var(--step--1); }
.toast--ok { border-left: 4px solid #5BB98A; }
.toast--error { border-left: 4px solid #E5806D; }
.toast button { margin-left: auto; background: none; border: 0; color: #C9D4DF; cursor: pointer; font-size: 18px; line-height: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; background: var(--ground); color: var(--slate); white-space: nowrap; }
.pill--green { background: var(--green-soft); color: var(--green); }
.pill--amber { background: var(--amber-soft); color: var(--amber); }
.pill--red { background: var(--red-soft); color: var(--red); }
.pill--navy { background: var(--navy-soft); color: var(--navy); }

/* Page heading block for inner pages */
.page-hero { padding: clamp(48px, 7vw, 88px) 0 clamp(32px, 5vw, 56px); border-bottom: 1px solid var(--line); }
.page-hero h1 { max-width: 18ch; }
.page-hero .lead { margin-top: 12px; }
.crumbs { font-size: var(--step--1); color: var(--slate); margin-bottom: 14px; }
.crumbs a { color: var(--slate); }

/* Prose (articles, policies) */
.prose { max-width: 68ch; font-size: 1.0625rem; line-height: 1.75; }
.prose h2 { font-size: var(--step-3); margin-top: 1.8em; }
.prose h3 { font-size: var(--step-2); margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--navy); color: var(--slate); font-family: var(--serif); font-size: var(--step-1); }
.prose img { border-radius: var(--radius-s); margin: 1.5em 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: var(--step--1); }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-m); background: #fff; }
table.table { border-collapse: collapse; width: 100%; font-size: var(--step--1); }
.table th { text-align: left; font-weight: 600; color: var(--slate); background: var(--ground); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.num, .table th.num { text-align: right; white-space: nowrap; }

/* Skeleton loading */
.skeleton { background: #E6EAEE; animation: pulse 1.2s ease-in-out infinite; border-radius: var(--radius-s); min-height: 16px; }
@keyframes pulse { 50% { opacity: .45; } }

/* Dialog */
dialog.dialog { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 0; width: min(560px, calc(100% - 32px)); color: var(--ink); }
dialog.dialog::backdrop { background: rgba(15, 42, 68, .45); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: var(--step-2); margin: 0; }
.dialog-body { padding: 22px; max-height: 70vh; overflow: auto; }
.dialog-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: var(--radius-s); cursor: pointer; color: var(--slate); }
.icon-btn:hover { background: var(--ground); color: var(--navy); }

/* Reveal on scroll: one quiet movement, disabled for reduced motion */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Utilities */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 16px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
[hidden] { display: none !important; }
