/* Innovate Portal – palette follows the MedHack website/logo */
:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --navy: #0e1e3e;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e7e2da;
  --cyan: #0284c7;
  --cyan-dark: #0369a1;
  --magenta: #d92662;
  --green: #059669;
  --amber: #d97706;
  --red: #c81e1e;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(14, 30, 62, .06), 0 4px 16px rgba(14, 30, 62, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(rgba(2, 132, 199, .07) 1px, transparent 1px);
  background-size: 28px 28px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--cyan-dark); }
a:hover { color: var(--navy); }
h1, h2, h3 { color: var(--navy); line-height: 1.25; letter-spacing: -.02em; }
h1 { font-size: 1.6rem; margin: 0 0 .5rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .75rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }

.wrap { width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 24px; padding-bottom: 48px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.prewrap { white-space: pre-wrap; }
.req { color: var(--magenta); }

/* Top bar */
.topbar { background: var(--navy); color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand img { border-radius: 8px; background: #fff; object-fit: contain; }
.brand span { display: flex; flex-direction: column; line-height: 1.2; }
.brand small { color: #b8c4dc; font-size: .75rem; }
.topnav { display: flex; align-items: center; gap: 16px; }
.topnav a, .topnav .linklike { color: #fff; font-size: .9rem; }
.topnav form { margin: 0; }

.footer { border-top: 1px solid var(--line); background: #fff; padding: 16px 0; font-size: .875rem; color: var(--muted); }
.footer p { margin: .25rem 0; }

/* Cards & layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px; }
.card > h1:first-child, .card > h2:first-child { margin-top: 0; }
.card.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.event-card { display: block; text-decoration: none; color: inherit; }

.hero { text-align: center; padding: 16px 0 24px; }
.hero h1 { font-size: 1.9rem; }
.hero-logo { border-radius: 16px; background: #fff; box-shadow: var(--shadow); object-fit: contain; }
.lead { font-size: 1.1rem; color: var(--muted); margin: .25rem 0; }
.deadline { display: inline-block; margin-top: 12px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px; font-size: .95rem; }
.deadline.closed { border-color: #f5c2c2; color: var(--red); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--cyan); margin: 0 0 .25rem; }

.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
.page-head.inner { margin-bottom: 0; }
.status-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; min-width: 200px; }
.status-box p { margin: .4rem 0 0; }
.app-no { font-size: 1.4rem; color: var(--navy); letter-spacing: .02em; }

ul.ticks { padding-left: 0; list-style: none; }
ul.ticks li { padding-left: 1.6rem; position: relative; margin: .4rem 0; }
ul.ticks li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 700; }
ul.links, ul.plain { padding-left: 1.1rem; margin: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 20px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--navy); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--navy); color: var(--navy); }
.btn-primary { background: var(--cyan); border-color: var(--cyan); color: #fff; }
.btn-primary:hover { background: var(--cyan-dark); border-color: var(--cyan-dark); color: #fff; }
.btn-primary:disabled { background: #9cc9e3; border-color: #9cc9e3; cursor: not-allowed; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--cyan-dark); text-decoration: underline; cursor: pointer; }
.linklike:disabled { color: var(--muted); text-decoration: none; cursor: default; }

/* Alerts & badges */
.alert { border-radius: 10px; padding: 12px 16px; margin: 0 0 16px; border: 1px solid; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-info { background: #eff8ff; border-color: #bae0fd; color: #075985; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #eef2f7; color: var(--navy); font-size: .8rem; font-weight: 600; }
.badge.small { font-size: .7rem; padding: 1px 8px; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-amber { background: #fef3c7; color: #92400e; }

/* Forms */
form { margin: 0; }
.field { margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }
fieldset.field { margin-bottom: 18px; }
label, legend { display: block; font-weight: 600; color: var(--navy); margin-bottom: 6px; font-size: .95rem; }
legend { padding: 0; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input[type=password], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: #fff;
  border: 1px solid #cfd6e0; border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(2, 132, 199, .25); border-color: var(--cyan); }
input:disabled { background: #f3f4f6; color: var(--muted); }
[aria-invalid=true] { border-color: var(--red) !important; }
input[type=file] { font: inherit; width: 100%; padding: 10px; border: 1px dashed #b6c0cf; border-radius: 10px; background: #fafbfc; }
.hint { font-size: .825rem; color: var(--muted); margin: 4px 0 0; }
.field-error { font-size: .85rem; color: var(--red); margin: 4px 0 0; font-weight: 500; }
.has-error { border-left: 3px solid var(--red) !important; padding-left: 12px !important; }
.input-prefix { display: flex; }
.input-prefix span { display: flex; align-items: center; padding: 0 12px; border: 1px solid #cfd6e0; border-right: 0; border-radius: 10px 0 0 10px; background: #f3f4f6; color: var(--muted); }
.input-prefix input { border-radius: 0 10px 10px 0; }
.otp-input { font-size: 1.6rem !important; letter-spacing: .5em; text-align: center; font-weight: 700; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.narrow-field { max-width: 320px; }

.choice { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; color: var(--text); padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; margin: 0; }
.choice input { margin-top: 4px; accent-color: var(--cyan); width: 18px; height: 18px; flex: none; }
.choice:has(input:checked) { border-color: var(--cyan); background: #f0f9ff; }
.choice.block { margin-bottom: 8px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }

.form-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.section-title { border-bottom: 1px solid var(--line); padding-bottom: 6px; display: flex; justify-content: space-between; align-items: baseline; }
.edit-link { font-size: .875rem; font-weight: 600; }

.member { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 0; margin: 0 0 16px; background: #fcfbf9; }
.member legend { font-size: 1rem; padding: 0 6px; }
.letters { margin-top: 8px; }
.letter-row { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #fff; }
.letter-row strong { display: block; color: var(--navy); }
.file-current { font-size: .9rem; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 8px; padding: 8px 12px; margin: 0 0 8px; }

/* Stepper */
.stepper { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 20px; counter-reset: s; }
.step { flex: 1; min-width: 0; }
.step > a, .step > span { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 10px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--muted); height: 100%; }
.step-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: #eef2f7; color: var(--navy); }
.step-label { font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step.done .step-num { background: var(--green); color: #fff; }
.step.done > a, .step.done > span { color: var(--navy); }
.step.current > span { border-color: var(--cyan); color: var(--navy); box-shadow: 0 0 0 3px rgba(2, 132, 199, .15); }
.step.current .step-num { background: var(--cyan); color: #fff; }

/* Dashboard progress */
.progress-list { list-style: none; padding: 0; margin: 0 0 12px; }
.progress-list li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.progress-list li:last-child { border-bottom: 0; }
.pl-num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: #eef2f7; color: var(--navy); }
.progress-list li.done .pl-num { background: var(--green); color: #fff; }
.progress-list li.next .pl-num { background: var(--cyan); color: #fff; }
.pl-body { flex: 1; display: flex; flex-direction: column; }
.pl-body small { color: var(--muted); }

/* Summary */
.summary { display: grid; grid-template-columns: 220px 1fr; gap: 8px 16px; margin: 0 0 8px; }
.summary dt { color: var(--muted); font-size: .9rem; }
.summary dd { margin: 0; }
.table-wrap { overflow-x: auto; margin-bottom: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; background: #faf9f7; }
.submit-box { margin-top: 20px; background: #f0f9ff; border: 1px solid #bae0fd; border-radius: var(--radius); padding: 16px; }
.submit-box .form-actions { border-top: 0; padding-top: 0; margin-top: 12px; }
.resend { margin-top: 16px; }

/* Payment */
.pay-box { background: #faf9f7; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; }

/* Staff area */
.topbar.admin { background: #0b1730; }
.admin-nav { background: #fff; border-bottom: 1px solid var(--line); }
.admin-nav .wrap { display: flex; gap: 4px; overflow-x: auto; }
.admin-nav a { padding: 12px 14px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.admin-nav a.active, .admin-nav a:hover { color: var(--navy); border-bottom-color: var(--cyan); }
.wrap.wide { max-width: 1280px; }
.role-chip { font-size: .75rem; background: rgba(255,255,255,.12); color: #dbe4f5; padding: 2px 8px; border-radius: 999px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
a.tile:hover { border-color: var(--cyan); }
.tile .num { font-size: 1.8rem; font-weight: 800; color: var(--navy); line-height: 1.1; display: block; font-variant-numeric: tabular-nums; }
.tile .lbl { font-size: .85rem; color: var(--muted); }
.tile.accent { border-top: 3px solid var(--cyan); }
.tile.green { border-top: 3px solid var(--green); }
.tile.amber { border-top: 3px solid var(--amber); }
.tile.magenta { border-top: 3px solid var(--magenta); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.table tr:hover td { background: #fbfaf8; }
.table a.rowlink { font-weight: 600; text-decoration: none; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; margin-bottom: 12px; }
.filters .field { margin: 0; }
.filters label { font-size: .8rem; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; background: #eef2f7; color: var(--navy); }
.pill-shortlisted, .pill-verified, .pill-submitted-app { background: #d1fae5; color: #065f46; }
.pill-not_shortlisted, .pill-rejected { background: #fee2e2; color: #991b1b; }
.pill-on_hold, .pill-submitted, .pill-pending-pay { background: #fef3c7; color: #92400e; }
.pill-draft { background: #eef2f7; color: var(--muted); }
.decision-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; background: #fcfbf9; }
.decision-box h3 { margin-top: 0; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.history { font-size: .85rem; list-style: none; padding: 0; margin: 0; }
.history li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .875rem; }
.btn-danger { color: var(--red); border-color: #fecaca; }
.btn-danger:hover { border-color: var(--red); color: var(--red); }
details.inline summary { cursor: pointer; color: var(--cyan-dark); font-weight: 600; margin: 8px 0; }

@media (max-width: 960px) {
  .layout-2 { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  h1 { font-size: 1.35rem; }
  .hero h1 { font-size: 1.5rem; }
  .card { padding: 18px 16px; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .summary { grid-template-columns: 1fr; gap: 2px; }
  .summary dd { margin-bottom: 10px; }
  .step-label { display: none; }
  .step.current .step-label { display: inline; }
  .step > a, .step > span { justify-content: center; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
  .progress-list li { flex-wrap: wrap; }
  .progress-list .btn { width: 100%; }
  .brand small { display: none; }
}
