@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* These are fallback defaults only - the actual colors shown come from the
   Settings admin page (site_settings table), injected as a <style> override
   in public/index.php's <head>. These :root values just define what a fresh
   install looks like before anyone has changed the Settings page. */
:root {
  --brand: #111827;
  --brand-a: #0f2942;
  --brand-b: #1e3a5f;
  --brand-c: #0f2942;
  --gold: #b8860b;
  --brand-soft: #f3f6f9;
  --accent: #1e3a5f;
  --glass-bg: #ffffff;
  --card-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
  --soft-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  --muted: #6b7280;
  --border: #dde3ea;
  --page-bg: #f4f7fa;
  --ink: #101828;
}
body {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.74), rgba(244,247,250,0.94) 230px),
    var(--page-bg);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- Shell layout ---------- */
.app-shell { display: flex; align-items: flex-start; gap: 28px; max-width: 1360px; margin: 0 auto; padding: 28px; }

.app-sidebar {
  width: 318px; min-width: 318px; min-height: calc(100vh - 120px); padding: 30px 26px;
  background: linear-gradient(155deg, var(--brand-a) 0%, #173b5f 54%, var(--brand-b) 100%);
  color: #fff; position: sticky; top: 96px; border-radius: 8px;
  box-shadow: 0 22px 48px rgba(15, 41, 66, 0.22);
  overflow: hidden;
}
.app-sidebar::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 5px;
  background: linear-gradient(90deg, var(--gold), rgba(255,255,255,0.5), transparent);
}

.sidebar-kicker { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 800; color: rgba(255,255,255,0.68); margin-bottom: 12px; }
.sidebar-headline { font-size: 1.5rem; font-weight: 800; line-height: 1.25; margin-bottom: 12px; }
.sidebar-copy { font-size: 0.87rem; opacity: 0.88; margin-bottom: 22px; }
.sidebar-progress { height: 6px; background: rgba(255,255,255,0.16); border-radius: 999px; overflow: hidden; margin: 0 0 22px; }
.sidebar-progress-fill { width: 20%; height: 100%; background: var(--gold); border-radius: inherit; transition: width 180ms ease; }

.sidebar-steps { list-style: none; margin: 0 0 26px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sidebar-steps .step-label {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 8px;
  font-size: 0.86rem; font-weight: 600; color: rgba(255,255,255,0.75); cursor: default;
}
.sidebar-steps .step-num {
  width: 26px; height: 26px; min-width: 26px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 0.78rem; font-weight: 700;
  background: rgba(255,255,255,0.14); color: rgba(255,255,255,0.9);
}
.sidebar-steps .step-label.active { background: rgba(255,255,255,0.16); color: #fff; }
.sidebar-steps .step-label.active .step-num { background: var(--gold); color: #fff; }
.sidebar-steps .step-label.done { color: #fff; cursor: pointer; }
.sidebar-steps .step-label.done .step-num { background: rgba(255,255,255,0.9); color: var(--brand-b); }
.sidebar-steps .step-label.done:hover { background: rgba(255,255,255,0.1); }

.sidebar-note {
  font-size: 0.78rem; background: rgba(255,255,255,0.11); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px; padding: 14px; line-height: 1.5;
}
.sidebar-note a { color: #fff; text-decoration: underline; }

.app-main { flex: 1; min-width: 0; max-width: 1000px; }

.single-page-shell {
  display: block;
  max-width: 1240px;
  padding: 22px 28px 52px;
}
.single-page-main {
  max-width: none;
  width: 100%;
}
.single-page-main .single-intro {
  display: block;
  margin: 0 0 20px;
  background: linear-gradient(135deg, var(--brand-a) 0%, #18466a 68%, var(--brand-b) 100%);
  border: 1px solid rgba(221,227,234,0.92);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
  overflow: hidden;
}
.single-intro-copy {
  min-height: 118px;
  padding: 22px 26px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 18px;
}
.single-intro-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 7px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.14);
  flex: 0 0 auto;
}
.single-intro-title {
  min-width: 0;
  margin-right: auto;
}
.single-intro h1 {
  max-width: 680px;
  margin: 0 0 4px;
  font-size: 1.85rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0;
}
.single-intro p {
  max-width: 620px;
  margin: 0;
  color: rgba(255,255,255,0.82);
  font-size: 0.9rem;
}
.single-intro-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.34);
  border-radius: 6px;
  padding: 8px 11px;
  background: rgba(255,255,255,0.12);
  overflow-wrap: anywhere;
  max-width: 280px;
  text-align: center;
  flex: 0 1 auto;
}
.single-intro-contact:hover {
  color: #fff;
  background: rgba(255,255,255,0.18);
}
.single-page-main form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
.single-page-main .section {
  margin-bottom: 0;
  box-shadow: none;
  border-left: 4px solid var(--brand-a);
}
.single-page-main .section:nth-of-type(3n + 1) { border-left-color: var(--brand-a); }
.single-page-main .section:nth-of-type(3n + 2) { border-left-color: var(--gold); }
.single-page-main .section:nth-of-type(3n + 3) { border-left-color: var(--accent); }
.single-page-main .section-header-bar {
  justify-content: flex-start;
  text-align: left;
  font-size: 0.82rem;
  color: #1f2937;
}
.single-page-main .section-header-bar::before {
  width: 32px;
  height: 3px;
  border-radius: 999px;
}
.single-page-main .table-responsive {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: auto;
}
.single-page-main .table {
  margin-bottom: 0;
}
.single-page-main .form-control,
.single-page-main .form-select {
  background-color: #fbfcfd;
}
.single-page-main .form-control:focus,
.single-page-main .form-select:focus {
  background-color: #fff;
}
.single-page-main .row.g-3 {
  align-items: start;
}
.single-page-main textarea.form-control {
  min-height: 58px;
}
.is-hidden-future {
  display: none !important;
}

.form-hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 22px;
  padding: 4px 2px 22px; margin-bottom: 4px;
}
.form-eyebrow { color: var(--gold); font-size: 0.74rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 8px; }
.form-hero h1 { color: var(--brand-a); font-size: 2rem; line-height: 1.15; font-weight: 800; margin: 0 0 8px; letter-spacing: 0; }
.form-hero p { color: var(--muted); max-width: 640px; margin: 0; font-size: 0.95rem; }
.form-hero-meta {
  min-width: 170px; padding: 13px 16px; border: 1px solid var(--border); border-radius: 8px;
  background: rgba(255,255,255,0.7); box-shadow: var(--soft-shadow); text-align: right;
}
.form-hero-meta span { display: block; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 800; }
.form-hero-meta strong { color: var(--brand-a); font-size: 0.9rem; }

@media (max-width: 900px) {
  .app-shell { flex-direction: column; padding: 18px; gap: 18px; }
  .app-sidebar { width: 100%; min-width: 0; min-height: auto; position: static; }
  .app-main { width: 100%; }
  .form-hero { flex-direction: column; align-items: flex-start; }
  .form-hero-meta { text-align: left; width: 100%; }
  .single-page-shell { padding: 18px; }
  .single-page-main .single-intro { background: var(--brand-a); }
  .single-intro-copy { min-height: auto; padding: 20px; align-items: flex-start; flex-wrap: wrap; }
}

/* ---------- Sections ---------- */
.section {
  background: var(--glass-bg); border-radius: 8px; padding: 20px; margin-bottom: 18px;
  box-shadow: var(--card-shadow); border: 1px solid rgba(221,227,234,0.88);
}
.section-header-bar {
  display: flex; align-items: center; gap: 9px; color: var(--brand-a); padding: 0 0 10px;
  font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 16px;
  border-bottom: 1px solid var(--border); background: transparent; border-radius: 0;
}
.section-header-bar::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: 0 0 auto;
}

.form-label { font-size: 0.82rem; font-weight: 700; margin-bottom: 5px; color: #344054; }
.form-control, .form-select {
  border-radius: 6px; border-color: var(--border); font-size: 0.86rem; padding: 8px 10px; min-height: 40px;
  background-color: #fff;
}
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30,58,95,0.13); }
textarea.form-control { min-height: auto; }
.btn { font-size: 0.83rem; }
.btn-brand {
  background: var(--brand-a); color: #fff; border: none; border-radius: 6px; padding: 10px 22px; font-weight: 800;
  box-shadow: 0 8px 18px rgba(15,41,66,0.18);
}
.btn-brand:hover { background: #0a1b2c; color: #fff; }
.btn-outline-soft { border-radius: 6px; border: 1px solid var(--border); background: #fff; padding: 8px 13px; color: #344054; font-weight: 700; }
.btn-outline-soft:hover { border-color: var(--accent); color: var(--brand-a); background: var(--brand-soft); }
.table { font-size: 0.8rem; }
.table thead th { background: var(--brand-soft); color: var(--brand-a); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 7px 8px; vertical-align: middle; }
.table-bordered { border-color: var(--border); }
.table td input[type="number"] { min-width: 44px; text-align: center; padding-left: 4px; padding-right: 4px; }
.small-muted { color: var(--muted); font-size: 0.78rem; }
.invalid-feedback.d-block { margin-top: 4px; color: #b91c1c; font-size: 0.76rem; }

.form-label.required:after { content: " *"; color: #b91c1c; font-weight: 700; }
.add-button { margin-top: 6px; display: inline-block; font-size: 0.78rem; }
.btn-add-exp { background: var(--brand-soft); color: var(--brand-a); border: 1px solid var(--border); }
.year-select { min-width: 100px; }
.locked-label { color: var(--muted); font-size: 0.78rem; }
.form-check-label { font-size: 0.82rem; }

/* ---------- Acknowledgement / success card ---------- */
.ack-card {
  max-width: 640px; margin: 32px auto; background: var(--glass-bg); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg, 0 16px 40px rgba(15,41,66,0.14)); padding: 0 0 40px;
  text-align: center; overflow: hidden;
}
.ack-band {
  height: 10px; background: linear-gradient(90deg, var(--brand-a) 0%, var(--brand-b) 55%, var(--gold) 100%);
}
.ack-logo { height: 44px; width: auto; margin: 28px auto 0; display: block; }
.ack-check {
  width: 72px; height: 72px; margin: 20px auto 18px; border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #15803d); color: #fff; font-size: 2rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(21,128,61,0.3);
}
.ack-title { font-size: 1.5rem; font-weight: 800; color: var(--brand-a); margin: 0 40px 14px; }
.ack-lead { color: #374151; font-size: 0.95rem; margin: 0 40px 10px; }
.ack-sub { color: var(--muted); font-size: 0.85rem; margin: 0 40px 6px; }

.ack-number-box {
  margin: 26px 40px; padding: 22px; border-radius: 14px; text-align: center;
  background: linear-gradient(135deg, var(--brand-a), var(--brand-b));
  box-shadow: 0 10px 24px rgba(15,41,66,0.25);
}
.ack-number-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.75); margin-bottom: 8px;
}
.ack-number-value { font-size: 2.4rem; font-weight: 800; color: var(--gold); letter-spacing: 0.02em; }

.ack-details {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; text-align: left; margin: 8px 40px 0;
  background: var(--brand-soft); border-radius: 12px; padding: 20px 22px;
}
.ack-detail-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-a); margin-bottom: 3px; opacity: 0.75; }
.ack-detail-value { font-size: 0.92rem; font-weight: 700; color: #111827; }

.ack-footer {
  margin: 30px 40px 0; padding-top: 18px; border-top: 1px dashed var(--border);
  font-size: 0.76rem; color: var(--muted); line-height: 1.6;
}
.ack-footer div:first-child { font-weight: 700; color: var(--brand-a); }

@media (max-width: 560px) {
  .ack-title, .ack-lead, .ack-sub, .ack-number-box, .ack-details, .ack-footer { margin-left: 20px; margin-right: 20px; }
  .ack-details { grid-template-columns: 1fr; }
}

/* ---------- Step nav (Back/Next within main content) ---------- */
.step-nav { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 28px; gap: 12px; }

@media (max-width: 560px) {
  .form-hero h1 { font-size: 1.55rem; }
  .single-intro h1 { font-size: 1.42rem; }
  .single-intro-logo { width: 56px; height: 56px; }
  .single-intro-copy { gap: 14px; }
  .single-intro-contact { width: 100%; justify-content: center; }
  .section { padding: 16px; }
  .step-nav { flex-direction: column-reverse; align-items: stretch; }
  .step-nav .btn { width: 100%; }
}
