/* =========================================================
   UDW International Scholarship
   Follows UDW's own print identity: orange, white and
   charcoal, bold geometric headings. The Lampung tapis band
   is the one decorative signature.
   ========================================================= */

:root {
  --brand: #EC6301;         /* UDW orange (from the official brochure) */
  --brand-light: #F7941D;   /* logo orange, used in gradients */
  --brand-strong: #C24E00;  /* orange that carries white text and links */
  --brand-deep: #A04000;    /* hover / pressed */
  --brand-tint: #FFF3E8;
  --cream: #FFF9F3;
  --ink: #222222;
  --charcoal: #26221F;      /* admin sidebar */
  --muted: #5F5A57;
  --line: #ECE5DF;
  --paper: #F8F6F4;
  --white: #FFFFFF;
  --gold-soft: #FFE8CC;
  --green: #2E6B4E;  --green-tint: #E7F2EC;
  --amber: #8A5206;  --amber-tint: #FBF1E0;
  --red: #A3243B;    --red-tint: #FBE9EC;
  --blue: #2B4C7E;   --blue-tint: #E8EEF7;

  --display: "Poppins", "Segoe UI", system-ui, sans-serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --focus: 0 0 0 3px rgba(236, 99, 1, .4);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 17px; line-height: 1.55; color: var(--ink); background: var(--paper); }
img { max-width: 100%; }
a { color: var(--brand-strong); text-underline-offset: 2px; }
a:hover { color: var(--brand-deep); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.015em; }
h1 { font-size: clamp(27px, 3.6vw, 36px); }
h2 { font-size: clamp(22px, 2.8vw, 28px); }
h3 { font-size: 18px; font-weight: 600; }
p { margin: 0 0 1em; }
.lead { font-size: 18px; color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--white); padding: 8px 12px; }
.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; }

/* ---------- Signature: Lampung tapis band ---------- */
.tapis {
  height: 12px;
  background:
    linear-gradient(135deg, var(--brand-light) 25%, transparent 25%) -6px 0 / 12px 12px,
    linear-gradient(225deg, var(--brand-light) 25%, transparent 25%) -6px 0 / 12px 12px,
    linear-gradient(315deg, var(--brand-light) 25%, transparent 25%) 0 0 / 12px 12px,
    linear-gradient(45deg,  var(--brand-light) 25%, transparent 25%) 0 0 / 12px 12px,
    var(--charcoal);
}

/* ---------- Header ---------- */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 74px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.logo { width: 48px; height: 48px; flex: none; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--display); font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.brand-text span { font-size: 14px; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 24px; }
.nav a { white-space: nowrap; }
.nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 600; }
.nav a:not(.btn):hover { color: var(--brand-strong); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: var(--r-sm);
  border: 1px solid transparent; cursor: pointer;
  font: 600 16px/1 var(--sans); text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--brand-strong); color: var(--white); }
.btn-primary:hover { background: var(--brand-deep); color: var(--white); }
.btn-ghost { background: var(--white); color: var(--ink); border-color: #DCD3CC; }
.btn-ghost:hover { border-color: var(--brand-strong); color: var(--brand-strong); }
.btn-white { background: var(--white); color: var(--brand-strong); }
.btn-white:hover { background: var(--brand-tint); color: var(--brand-deep); }
.btn-danger { background: var(--white); color: var(--red); border-color: #E6BFC6; }
.btn-danger:hover { background: var(--red-tint); color: var(--red); }
.btn-small { min-height: 38px; padding: 0 16px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--red); font: inherit; cursor: pointer; text-decoration: underline; }

/* ---------- Alerts & badges ---------- */
.flashes { margin: 20px 0 0; display: grid; gap: 8px; }
.alert { padding: 12px 16px; border-radius: var(--r-sm); border-left: 4px solid; background: var(--white); }
.alert-success { border-color: var(--green); background: var(--green-tint); }
.alert-error   { border-color: var(--red); background: var(--red-tint); }
.alert-info    { border-color: var(--blue); background: var(--blue-tint); }
.alert-warning { border-color: var(--amber); background: var(--amber-tint); }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.badge-submitted    { background: var(--blue-tint);  color: var(--blue);  border-color: #C9D5E8; }
.badge-under_review { background: var(--amber-tint); color: var(--amber); border-color: #EBD4AE; }
.badge-shortlisted  { background: var(--brand-tint); color: var(--brand-deep); border-color: #F6CFA9; }
.badge-accepted     { background: var(--green-tint); color: var(--green); border-color: #BFDCCB; }
.badge-rejected     { background: var(--red-tint);   color: var(--red);   border-color: #EBC3CA; }

/* ---------- Home: hero ---------- */
.hero { background: linear-gradient(180deg, var(--cream) 0%, var(--white) 100%); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: center; padding: 64px 20px 72px; }
.kicker { color: var(--brand-strong); font-weight: 700; font-size: 16px; margin-bottom: 14px; }
.hero h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.08; letter-spacing: -.025em; margin-bottom: 20px; max-width: 15ch; }
.hero .intro { font-size: 19px; color: var(--muted); max-width: 50ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-media { position: relative; margin: 0 24px 24px 0; }
.hero-media::before {
  content: ""; position: absolute; inset: 28px -24px -24px 28px; border-radius: var(--r-lg);
  background: linear-gradient(140deg, var(--brand-light), var(--brand) 60%, var(--brand-strong));
}
.hero-media img { position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-lg); box-shadow: 0 24px 48px -18px rgba(120, 50, 0, .35); }

.facts-band { background: var(--brand-strong); color: var(--white); }
.facts-band dl { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; }
.facts-band dl > div { padding: 22px 24px; border-left: 1px solid rgba(255,255,255,.25); }
.facts-band dl > div:first-child { border-left: 0; padding-left: 0; }
.facts-band dt { font-size: 15px; color: rgba(255,255,255,.88); }
.facts-band dd { margin: 2px 0 0; font-family: var(--display); font-size: 22px; font-weight: 700; }
.facts-band dd small { font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--gold-soft); margin-left: 8px; }

/* ---------- Home: sections ---------- */
.section { padding: 72px 0; background: var(--white); }
.section.alt { background: var(--paper); }
.section-head { max-width: 640px; margin-bottom: 36px; }
.split { display: grid; grid-template-columns: 1fr 1.4fr; gap: 56px; }

.benefits { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.benefits div { padding: 22px 22px 20px; border-radius: var(--r-md); background: var(--cream); border: 1px solid #F6E3D2; }
.benefits h3 { margin-bottom: 6px; color: var(--brand-deep); }
.benefits p { margin: 0; color: var(--muted); font-size: 16px; }

.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.ticks li { position: relative; padding-left: 32px; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 13px; height: 13px; background: var(--brand); transform: rotate(45deg); border-radius: 2px; }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.steps li { counter-increment: step; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px;
  border-radius: 50%; background: var(--brand); color: var(--white); font-family: var(--display); font-weight: 700; font-size: 18px;
}
.steps h3 { margin-bottom: 4px; }
.steps p { color: var(--muted); margin: 0; font-size: 16px; }

.doc-table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.doc-table td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table td:last-child { text-align: right; white-space: nowrap; }
.doc-table .hint { display: block; color: var(--muted); font-size: 15px; }
.req { color: var(--brand-strong); font-weight: 600; font-size: 15px; }
.opt { color: var(--muted); font-size: 15px; }

.closing {
  border-radius: var(--r-lg); padding: 40px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--brand-strong), var(--brand-deep)); color: var(--white);
}
.closing h2 { margin: 0 0 4px; color: var(--white); }
.closing p { margin: 0; color: rgba(255,255,255,.9); }

/* ---------- Footer ---------- */
.site-footer { background: linear-gradient(135deg, var(--brand-strong), var(--brand-deep)); color: rgba(255,255,255,.92); }
.site-footer a { color: var(--white); }
.foot { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 36px; padding-top: 44px; padding-bottom: 32px; }
.foot-brand { display: flex; gap: 14px; align-items: flex-start; }
.foot-brand img { width: 64px; height: 64px; background: var(--white); border-radius: 50%; padding: 5px; flex: none; }
.foot strong { color: var(--white); display: block; margin-bottom: 6px; font-family: var(--display); font-weight: 600; }
.foot p { margin: 0; font-size: 16px; }
.foot .motto { font-style: italic; margin-top: 8px; color: var(--gold-soft); }
.foot-legal { border-top: 1px solid rgba(255,255,255,.2); padding-top: 16px; padding-bottom: 24px; font-size: 14px; color: rgba(255,255,255,.85); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Cards & forms ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 28px; }
.card + .card { margin-top: 20px; }
.card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.card-title h2, .card-title h3 { margin: 0; }

.auth-wrap { display: flex; justify-content: center; padding: 48px 20px 72px; }
.auth-card { width: 100%; max-width: 480px; border-top: 4px solid var(--brand); }
.auth-card h1 { font-size: 26px; }
.auth-foot { margin: 20px 0 0; text-align: center; color: var(--muted); }

form { margin: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; }
legend { font-family: var(--display); font-size: 18px; font-weight: 600; margin-bottom: 14px; padding: 0; }
.field { margin-bottom: 18px; }
.field label, .label { display: block; font-weight: 600; margin-bottom: 6px; }
.field .hint { display: block; font-size: 15px; color: var(--muted); margin-top: 5px; }
.optional { font-weight: 400; color: var(--muted); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }

input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=tel], input[type=search], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; font: 400 16px/1.4 var(--sans); color: var(--ink);
  background: var(--white); border: 1px solid #D4CBC4; border-radius: var(--r-sm);
}
textarea { min-height: 220px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
input[type=file] { font: inherit; max-width: 100%; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--brand-strong); flex: none; }
.radio-row { display: flex; gap: 24px; min-height: 46px; align-items: center; }
.radio-row label { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 0; }
.radio-row input { width: 18px; height: 18px; accent-color: var(--brand-strong); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 70px; }
.pw-toggle { position: absolute; right: 6px; top: 6px; height: 34px; padding: 0 10px; border: 0; background: var(--paper); border-radius: 6px; font: 600 14px var(--sans); color: var(--muted); cursor: pointer; }
.counter { font-size: 14px; color: var(--muted); margin-top: 6px; }
.counter.ok { color: var(--green); }
.form-actions { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-actions .right { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Applicant area ---------- */
.page { padding-top: 32px; padding-bottom: 72px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin: 0; }
.page-head .meta { color: var(--muted); }
.layout-2 { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }

.status-panel { border-left: 6px solid var(--brand); }
.status-panel .badge { font-size: 15px; }
.status-panel p { margin: 12px 0 0; }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .name { display: flex; gap: 12px; align-items: center; font-weight: 600; }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #D4CBC4; flex: none; display: grid; place-items: center; }
.dot.done { background: var(--green); border-color: var(--green); }
.dot.done::after { content: ""; width: 6px; height: 10px; border: solid var(--white); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.checklist .sub { display: block; font-weight: 400; color: var(--muted); font-size: 15px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); }
.timeline time { display: block; font-size: 14px; color: var(--muted); }
.timeline p { margin: 2px 0 0; font-size: 15px; }

.kv { display: grid; grid-template-columns: 200px 1fr; gap: 8px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.side-facts .kv { grid-template-columns: 1fr; gap: 2px; }
.side-facts .kv dd { margin-bottom: 12px; }

.stepper { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; counter-reset: s; }
.stepper li { counter-increment: s; }
.stepper a { display: block; padding: 12px 12px 10px; border-top: 4px solid var(--line); color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.stepper a::before { content: counter(s) ". "; }
.stepper .done a { border-top-color: var(--green); color: var(--ink); }
.stepper .current a { border-top-color: var(--brand); color: var(--brand-strong); }

.doc-row { display: grid; grid-template-columns: 1fr auto; gap: 12px 24px; padding: 20px 0; border-bottom: 1px solid var(--line); align-items: center; }
.doc-row:last-child { border-bottom: 0; }
.doc-row h3 { font-family: var(--sans); font-size: 17px; font-weight: 600; margin: 0; letter-spacing: 0; }
.doc-row .hint { color: var(--muted); font-size: 15px; margin: 2px 0 0; }
.doc-file { font-size: 15px; margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.doc-file .ok { color: var(--green); font-weight: 600; }
.upload-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.review-block { padding: 22px 0; border-bottom: 1px solid var(--line); }
.review-block:first-child { padding-top: 0; }
.review-block h3 { display: flex; justify-content: space-between; align-items: baseline; }
.review-block h3 a { font-family: var(--sans); font-size: 15px; font-weight: 600; }
.essay-text { white-space: pre-wrap; background: var(--paper); border-radius: var(--r-sm); padding: 14px 16px; margin: 6px 0 0; font-size: 16px; max-height: 360px; overflow: auto; }

/* ---------- Admin ---------- */
body.admin, body.admin-auth { background: var(--paper); }
.admin-shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar { background: var(--charcoal); color: var(--white); padding: 22px 18px 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { color: var(--white); margin-bottom: 28px; }
.sidebar .logo { background: var(--white); border-radius: 50%; padding: 3px; }
.sidebar .brand-text span { color: rgba(255,255,255,.7); }
.sidebar nav { display: grid; gap: 2px; }
.sidebar nav a { color: rgba(255,255,255,.85); text-decoration: none; padding: 10px 12px; border-radius: var(--r-sm); font-weight: 500; }
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: var(--white); }
.sidebar nav a.active { background: rgba(236,99,1,.18); color: var(--white); box-shadow: inset 3px 0 0 var(--brand); }
.sidebar .who { margin-top: auto; padding: 16px 12px; border-top: 1px solid rgba(255,255,255,.12); font-size: 15px; display: flex; flex-direction: column; gap: 4px; }
.sidebar .who a { color: var(--gold-soft); }
.tapis-side { margin: 0 -18px; }
.admin-main { padding: 28px 32px 48px; min-width: 0; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 8px; }
.admin-top h1 { font-size: 26px; margin: 0; }
.admin-main .flashes { margin-bottom: 16px; }

.stats { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white); margin: 16px 0 24px; overflow: hidden; }
.stats a { padding: 18px 18px 16px; text-decoration: none; color: var(--ink); border-right: 1px solid var(--line); }
.stats a:last-child { border-right: 0; }
.stats a:hover { background: var(--cream); }
.stats .num { font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1; display: block; margin-bottom: 4px; }
.stats .lbl { font-size: 14px; color: var(--muted); }
.stats a.total { background: var(--brand-strong); color: var(--white); }
.stats a.total .lbl { color: rgba(255,255,255,.9); }
.stats a.total:hover { background: var(--brand-deep); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-2 > .card { margin-top: 0; }
.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: 150px 1fr 36px; gap: 12px; align-items: center; font-size: 15px; }
.bars .track, .bars .fill { display: block; }
.bars .track { height: 10px; background: var(--paper); border-radius: 5px; overflow: hidden; }
.bars .fill { height: 100%; background: var(--brand); border-radius: 5px; }
.bars .n { text-align: right; font-weight: 600; }

.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto; gap: 10px; margin: 16px 0; }
.table-wrap { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th { text-align: left; font-weight: 600; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); background: #FCFAF8; white-space: nowrap; }
table.data td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #FFFBF7; }
table.data .name { font-weight: 600; color: var(--ink); text-decoration: none; }
table.data .name:hover { color: var(--brand-strong); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 15px; color: var(--muted); }
.pager .links { display: flex; gap: 12px; }

.detail { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.detail .side { position: sticky; top: 20px; display: grid; gap: 20px; }
.detail .side .card + .card { margin-top: 0; }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.doc-list li:last-child { border-bottom: 0; }
.doc-list li > span:first-child { flex: 1; }
.doc-list li > :last-child { white-space: nowrap; }
.doc-list .missing { color: var(--red); }
.tapis-top { margin: -28px -28px 24px; border-radius: var(--r-md) var(--r-md) 0 0; }
.admin-auth .auth-card { border-top: 0; }
.brand-dark { margin-bottom: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .split, .layout-2, .detail, .grid-2 { grid-template-columns: 1fr; }
  .hero-grid { gap: 40px; padding-top: 40px; }
  .hero-media { max-width: 460px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .foot { grid-template-columns: 1fr 1fr; }
  .foot > div:first-child { grid-column: 1 / -1; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stats a:nth-child(3) { border-right: 0; }
  .stats a:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar nav { grid-template-columns: repeat(2, 1fr); }
  .sidebar .who { margin-top: 16px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .detail .side { position: static; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hide-sm { display: none; }
  .nav { gap: 14px; }
  .brand-text span { display: none; }
  .row, .benefits, .steps, .foot { grid-template-columns: 1fr; }
  .facts-band dl { grid-template-columns: 1fr; }
  .facts-band dl > div { border-left: 0; padding: 14px 0; border-top: 1px solid rgba(255,255,255,.2); }
  .facts-band dl > div:first-child { border-top: 0; }
  .hero-media { margin-right: 16px; }
  .closing { padding: 28px; }
  .stepper { grid-template-columns: 1fr; gap: 0; }
  .stepper a { border-top: 0; border-left: 4px solid var(--line); padding: 8px 12px; }
  .stepper .done a { border-left-color: var(--green); }
  .stepper .current a { border-left-color: var(--brand); }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dd { margin-bottom: 10px; }
  .doc-row { grid-template-columns: 1fr; }
  .upload-form { justify-content: flex-start; }
  .card { padding: 20px; }
  .admin-main { padding: 20px 16px 40px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats a { border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line); }
  .filters { grid-template-columns: 1fr; }
  .bars li { grid-template-columns: 100px 1fr 30px; }
  .doc-table td:last-child { text-align: left; }
  .doc-table tr { display: block; border-bottom: 1px solid var(--line); }
  .doc-table td { display: block; border: 0; padding: 10px 16px; }
}
@media (max-width: 480px) { .site-header .brand-text { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .site-header, .site-footer, .stepper, .form-actions, .no-print, .flashes { display: none !important; }
  body { background: var(--white); font-size: 12pt; }
  .card { border: 0; padding: 0; }
  .essay-text { max-height: none; background: none; padding: 0; }
}

/* =========================================================
   Dashboard motion
   One orchestrated entrance per page load, then everything
   stays still. Content is visible without JavaScript, and
   the fallback animation reveals it even if a script fails.
   ========================================================= */
.js [data-dashboard] .reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: reveal-fallback 0s linear 2.5s forwards;
}
.js [data-dashboard] .reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity .6s ease, transform .7s cubic-bezier(.22, 1, .36, 1);
}
@keyframes reveal-fallback { to { opacity: 1; transform: none; } }

[data-dashboard] .bars .fill { transition: width 1.1s cubic-bezier(.22, 1, .36, 1); }
[data-dashboard] .stats a { transition: background-color .2s ease, box-shadow .2s ease; }
[data-dashboard] .stats a:hover { box-shadow: inset 0 -3px 0 var(--brand); }
[data-dashboard] .stats a.total:hover { box-shadow: inset 0 -3px 0 var(--gold-soft); }

/* Progress ring on the applicant dashboard */
.status-body { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; }
.progress-ring { position: relative; width: 132px; height: 132px; flex: none; }
.progress-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 10; }
.ring-track { stroke: var(--brand-tint); }
.ring-bar { stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset 1.4s cubic-bezier(.22, 1, .36, 1); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring-label strong { font-family: var(--display); font-size: 28px; font-weight: 700; color: var(--ink); }
.ring-label small { font-size: 13px; color: var(--muted); margin-top: 2px; }
.dot.done { transition: transform .4s cubic-bezier(.34, 1.56, .64, 1); }
.js [data-dashboard] .checklist li.reveal:not(.is-in) .dot.done { transform: scale(.4); }

@media (max-width: 640px) {
  .status-body { grid-template-columns: 1fr; }
  .progress-ring { width: 112px; height: 112px; justify-self: start; order: -1; }
}
@media (prefers-reduced-motion: reduce) {
  .js [data-dashboard] .reveal { opacity: 1; transform: none; animation: none; }
  .ring-bar, [data-dashboard] .bars .fill, .dot.done { transition: none; }
}

/* ---------- Home page: reveal on scroll ---------- */
.js [data-motion] .reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: reveal-fallback 0s linear 3s forwards; /* safety net if the script never runs */
}
.js [data-motion].motion-ready .reveal { animation: none; }
.js [data-motion] .reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity .7s ease, transform .85s cubic-bezier(.22, 1, .36, 1);
}
/* Campus photo: rises like a curtain, then the orange frame settles behind it */
.js [data-motion] .reveal-media { transform: none; }
.js [data-motion] .reveal-media img {
  clip-path: inset(100% 0 0 0 round 20px);
  transition: clip-path 1.3s cubic-bezier(.65, 0, .35, 1);
}
.js [data-motion] .reveal-media.is-in img { clip-path: inset(0 0 0 0 round 20px); }
.js [data-motion] .reveal-media::before {
  opacity: 0;
  transform: translate(-22px, -22px);
  transition: opacity .6s ease .55s, transform 1s cubic-bezier(.22, 1, .36, 1) .55s;
}
.js [data-motion] .reveal-media.is-in::before { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js [data-motion] .reveal, .js [data-motion] .reveal-media img, .js [data-motion] .reveal-media::before {
    opacity: 1; transform: none; clip-path: none; animation: none; transition: none;
  }
}

/* =========================================================
   Revision Oct 2026: interest form, invitation flow, new content
   ========================================================= */

/* Status badges for the candidate pipeline */
.badge-new          { background: var(--blue-tint);  color: var(--blue);  border-color: #C9D5E8; }
.badge-contacted    { background: var(--amber-tint); color: var(--amber); border-color: #EBD4AE; }
.badge-invited      { background: var(--brand-tint); color: var(--brand-deep); border-color: #F6CFA9; }
.badge-interview    { background: #EFEAF8; color: #4B3A86; border-color: #D6CCEE; }
.badge-selected     { background: var(--green-tint); color: var(--green); border-color: #BFDCCB; }
.badge-not_selected { background: var(--red-tint);   color: var(--red);   border-color: #EBC3CA; }
.badge-admission    { background: var(--green);      color: var(--white); border-color: var(--green); }

/* Home: programmes by faculty */
.faculty-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.faculty-card { background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: var(--r-md); padding: 20px; }
.faculty-card h3 { margin-bottom: 2px; }
.faculty-card .local { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.faculty-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.faculty-card li { display: flex; flex-direction: column; padding-top: 10px; border-top: 1px solid var(--line); }
.faculty-card li strong { font-weight: 600; }
.faculty-card li span { font-size: 14px; color: var(--muted); }

.note { margin-top: 22px; padding: 16px 18px; background: var(--cream); border: 1px solid #F6E3D2; border-left: 4px solid var(--brand); border-radius: var(--r-sm); }
.note strong { display: block; margin-bottom: 2px; }

.steps-8 { grid-template-columns: repeat(4, 1fr); }

/* Home: indicative timeline */
.tl { list-style: none; margin: 0; padding: 0; border-left: 2px solid #F3D3B8; }
.tl li { position: relative; padding: 0 0 20px 26px; display: grid; gap: 2px; }
.tl li:last-child { padding-bottom: 0; }
.tl li::before { content: ""; position: absolute; left: -8px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--white); border: 3px solid var(--brand); }
.tl .when { font-family: var(--display); font-weight: 700; color: var(--brand-deep); }
.tl .what { color: var(--ink); }

.about p { max-width: 68ch; }
.partner { margin-top: 18px; padding: 18px 20px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); }
.partner strong { font-family: var(--display); }
.partner p { margin: 6px 0 0; color: var(--muted); }

.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden; background: var(--charcoal); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Interest form */
.interest-layout { display: grid; grid-template-columns: 1fr 1.6fr; gap: 40px; align-items: start; }
.interest-layout > .card:only-child { grid-column: 1 / -1; max-width: 720px; }
.interest-intro { position: sticky; top: 100px; }
.mini-steps { margin: 18px 0; padding-left: 20px; display: grid; gap: 8px; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.done-card { border-top: 4px solid var(--green); }
.done-card h1 { font-size: 26px; }

.prose { max-width: 800px; }
.prose h2 { font-size: 20px; margin-top: 26px; }
.prose p { max-width: 70ch; }

.prefilled { background: var(--cream); border-radius: var(--r-sm); padding: 14px 16px; grid-template-columns: 140px 1fr; margin-bottom: 8px; }

/* Applicant portal */
.committee-note { margin-top: 14px; padding: 12px 14px; background: var(--paper); border-left: 3px solid var(--brand); border-radius: 6px; }
.committee-note p { margin: 4px 0 0; }
.interview-card { border-left: 6px solid #6B5BB0; }
.interview-when { font-family: var(--display); font-weight: 600; font-size: 18px; }
.stage-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.stage-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--muted); }
.stage-list li.done { color: var(--ink); }
.stage-list li.current { color: var(--brand-deep); font-weight: 600; }
.stage-list li.current .dot { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }
.nim { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: .04em; color: var(--brand-deep); margin: 4px 0 0; }

/* Admin */
.stats-8 { grid-template-columns: repeat(8, 1fr); }
.stats-8 .lbl { font-size: 13px; }
.nim-form { display: flex; gap: 12px; align-items: flex-end; margin-top: 18px; flex-wrap: wrap; }
.nim-form .field { flex: 1; min-width: 220px; }

@media (max-width: 1100px) {
  .faculty-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-8 { grid-template-columns: repeat(4, 1fr); }
  .stats-8 a:nth-child(4n) { border-right: 0; }
  .stats-8 a:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 960px) {
  .interest-layout { grid-template-columns: 1fr; }
  .interest-intro { position: static; }
  .steps-8 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .faculty-grid, .steps-8 { grid-template-columns: 1fr; }
  .stats-8 { grid-template-columns: repeat(2, 1fr); }
  .prefilled { grid-template-columns: 1fr; }
}
