/* OEF portal and admin. Colours and type follow the website (mockup/tokens.css). */
:root {
  --paper: #FFFCFD; --paper-2: #FCF1F7; --paper-3: #F8E6F0;
  --ink: #24101F; --ink-2: #3D2C38; --muted: #6E5D69;
  --rule: #EEDFE8; --rule-2: #CDB8C6;
  --accent: #BF2A9C; --accent-2: #9C1F7F; --accent-soft: #F9DDEF; --signal: #FD8027;
  --plum: #2B0E26; --error: #C0262D; --error-soft: #FBE7E8; --success: #1F7A45; --success-soft: #E3F3E9;
  --display: "Poppins", ui-sans-serif, system-ui, sans-serif; --body: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(43 14 38 / .05), 0 12px 32px -14px rgb(43 14 38 / .22);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--paper-2); color: var(--ink); font: 16px/1.55 var(--body); }
a { color: var(--accent-2); }
h1, h2, h3 { margin: 0; font-family: var(--display); line-height: 1.15; letter-spacing: -0.02em; color: var(--plum); }
h1 { font-size: clamp(1.6rem, 2vw + 1rem, 2.1rem); }
h2 { font-size: 1.25rem; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 10; background: #fff; padding: 8px 12px; }

/* Top bar */
.bar { background: var(--paper); border-bottom: 1px solid var(--rule); }
.bar__in { max-width: 1120px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
.bar__logo img { display: block; height: 40px; width: auto; }
.bar__nav { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bar__nav a, .bar__nav button { font: 500 15px var(--body); color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: 999px; background: none; border: 0; cursor: pointer; }
.bar__nav a:hover, .bar__nav button:hover, .bar__nav a[aria-current="page"] { background: var(--paper-3); color: var(--plum); }

/* Layout */
.page { max-width: 1120px; margin: 0 auto; padding: 32px 20px 64px; }
.narrow { max-width: 460px; margin: 0 auto; }
.stack { display: grid; gap: 16px; }
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
@media (max-width: 520px) { .card { padding: 22px 18px; } .page { padding-top: 20px; } }
.lead { color: var(--ink-2); }
.small { font-size: 14px; color: var(--muted); }
.center { text-align: center; }

/* Forms */
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 15px; }
.field .hint { font-size: 13.5px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=number], select, textarea {
  width: 100%; font: 16px var(--body); color: var(--ink); background: #fff;
  border: 1.5px solid var(--rule-2); border-radius: var(--radius-sm); padding: 12px 14px; min-height: 48px;
}
textarea { min-height: 180px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input[aria-invalid=true], select[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--error); }
.code-input { font-size: 28px !important; letter-spacing: 10px; text-align: center; font-variant-numeric: tabular-nums; }
.row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px;
  font: 600 16px var(--body); border-radius: 999px; border: 2px solid var(--plum); background: #fff; color: var(--plum); text-decoration: none; cursor: pointer; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn--block { width: 100%; }
.btn:active { transform: translateY(1px); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-2); text-decoration: underline; cursor: pointer; }

/* Messages */
.alert { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 15px; }
.alert--error { background: var(--error-soft); color: #7A1419; }
.alert--ok { background: var(--success-soft); color: #14512D; }
.alert--info { background: var(--accent-soft); color: var(--plum); }
.err { color: var(--error); font-size: 14px; }

/* Application form */
.app-grid { display: grid; gap: 28px; grid-template-columns: 240px minmax(0, 1fr); align-items: start; max-width: 1000px; }
@media (max-width: 860px) { .app-grid { grid-template-columns: 1fr; } }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.steps__item a, .steps__item span { display: block; padding: 10px 14px; border-radius: var(--radius-sm); text-decoration: none; color: var(--muted); font-weight: 500; }
.steps__item a { color: var(--ink-2); }
.steps__item.is-done a::after { content: " ✓"; color: var(--success); }
.steps__item.is-here a { background: var(--accent-soft); color: var(--plum); font-weight: 700; }
@media (max-width: 860px) {
  .steps { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: thin; }
  .steps__item a, .steps__item span { white-space: nowrap; padding: 8px 12px; background: var(--paper); border: 1px solid var(--rule); }
  .steps__item.is-here a { border-color: var(--accent); background: var(--accent-soft); }
}
.actions { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; padding-top: 8px; }
.actions .btn--primary { margin-left: auto; }
.radios { border: 0; padding: 0; margin: 0; }
.radios legend { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.radios label { display: inline-flex; align-items: center; gap: 8px; margin-right: 22px; min-height: 44px; font-weight: 500; }
.radios input, .check input { width: 20px; height: 20px; accent-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
input[type=file] { font: 15px var(--body); padding: 10px 0; }
.filehave { font-size: 14px; color: var(--success); font-weight: 600; }
.summary { margin: 0; display: grid; gap: 0; }
.summary div { display: grid; grid-template-columns: 200px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.summary div:last-child { border-bottom: 0; }
.summary dt { color: var(--muted); font-size: 15px; }
.summary dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 520px) { .summary div { grid-template-columns: 1fr; gap: 2px; } }

/* Admin */
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tiles a { display: grid; gap: 2px; padding: 16px 18px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; color: var(--ink-2); }
.tiles a b { font: 700 1.75rem/1 var(--display); color: var(--plum); }
.tiles a.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.filters { display: grid; gap: 10px; grid-template-columns: 2fr repeat(4, 1fr) auto; padding: 16px; }
.filters input, .filters select { min-height: 44px; padding: 8px 12px; }
@media (max-width: 1000px) { .filters { grid-template-columns: 1fr 1fr; } .filters input { grid-column: 1 / -1; } }
.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--paper-2); }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table tbody tr:hover { background: var(--paper-2); }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--paper-3); color: var(--plum); white-space: nowrap; }
.badge--processing { background: #FFF1D6; color: #7A4B00; }
.badge--shortlisted { background: #E2ECFF; color: #1F3F8A; }
.badge--awarded { background: var(--success-soft); color: #14512D; }
.badge--rejected, .badge--cancelled { background: var(--error-soft); color: #7A1419; }
.pager { display: flex; align-items: center; gap: 14px; justify-content: center; }
.detail-grid { display: grid; gap: 24px; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.doclist { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.essay { white-space: pre-wrap; line-height: 1.7; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

/* Phone fixes: keep the form inside the screen and the top menu on one row */
.app-grid > * { min-width: 0; }
@media (max-width: 860px) { .app-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .bar__in { flex-wrap: wrap; padding: 10px 16px; gap: 6px 12px; }
  .bar__logo img { height: 34px; }
  .bar__nav { margin-left: 0; width: 100%; gap: 2px; flex-wrap: nowrap; overflow-x: auto; }
  .bar__nav a, .bar__nav button { padding: 6px 10px; font-size: 14px; white-space: nowrap; }
  .bar__nav form { margin-left: auto; }
  .page { padding: 18px 16px 48px; }
}
