:root {
  --saffron: #e07a1f;
  --saffron-d: #b85f10;
  --maroon: #7a1f2b;
  --cream: #fdf8ef;
  --paper: #ffffff;
  --ink: #2b2420;
  --muted: #6f655c;
  --line: #eadfce;
  --green: #1f7a3f;
  --green-bg: #e6f4ea;
  --red: #b3261e;
  --red-bg: #fbe9e7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 30, 10, .06), 0 6px 24px rgba(60, 30, 10, .07);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font: 16px/1.6 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
a { color: var(--maroon); }
h1, h2, h3 { font-family: "Cormorant Garamond", Georgia, serif; color: var(--maroon); line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.6rem; }
code { background: #f6ead7; padding: .1em .35em; border-radius: 5px; font-size: .92em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 460px; padding-top: 40px; padding-bottom: 40px; }
.narrow-lg { max-width: 680px; }
.section { padding-top: 40px; padding-bottom: 56px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.eyebrow { color: var(--saffron-d); font-weight: 600; letter-spacing: .02em; margin: 0 0 .4em; }

/* header */
.top { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand strong { display: block; font-size: 1rem; color: var(--maroon); }
.brand small { display: block; font-size: .75rem; color: var(--muted); }
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--saffron), var(--maroon)); color: #fff; font-size: 1.3rem;
}
nav { display: flex; align-items: center; gap: 16px; }
nav a { text-decoration: none; font-weight: 500; color: var(--ink); }
nav a:hover { color: var(--maroon); }
.inline { display: inline; margin: 0; }
.link { background: none; border: 0; padding: 0; font: inherit; font-weight: 500; color: var(--ink); cursor: pointer; }
.link:hover { color: var(--maroon); }

/* buttons */
.btn {
  display: inline-block; background: var(--saffron); color: #fff !important; border: 0; border-radius: 999px;
  padding: .7em 1.4em; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: var(--saffron-d); }
.btn-sm { padding: .45em 1em; font-size: .9rem; }
.btn-block { width: 100%; margin-top: 8px; }

/* hero */
.hero {
  background:
    radial-gradient(1200px 400px at 85% -10%, rgba(224, 122, 31, .18), transparent 60%),
    radial-gradient(800px 300px at 0% 110%, rgba(122, 31, 43, .10), transparent 60%);
  padding: 56px 0 40px; border-bottom: 1px solid var(--line);
}
.hero-sub { max-width: 620px; font-size: 1.1rem; color: var(--muted); margin: 0 0 28px; }
.notice {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--saffron);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); max-width: 720px;
}
.notice strong { display: block; color: var(--maroon); font-size: 1.05rem; }
.notice span { color: var(--muted); font-size: .95rem; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.course { display: flex; flex-direction: column; }
.course .lead { font-weight: 600; margin-top: 0; }
.course ul { padding-left: 1.2em; margin: 0 0 18px; }
.course .btn, .course > p:last-child { margin-top: auto; align-self: flex-start; }
.tag { align-self: flex-start; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  background: #f3ece2; color: var(--muted); border-radius: 999px; padding: .25em .8em; margin-bottom: 12px; }
.tag-live { background: var(--green-bg); color: var(--green); }

/* forms */
.form-card h1 { font-size: 2.2rem; }
label { display: block; font-weight: 500; margin: 14px 0 0; }
input {
  display: block; width: 100%; margin-top: 6px; padding: .75em .9em; font: inherit;
  border: 1px solid #d9cbb6; border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus { outline: 2px solid var(--saffron); outline-offset: 1px; border-color: transparent; }
.help { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .92rem; }
.help p { margin: 0 0 .6em; }
.alert { background: var(--red-bg); color: var(--red); border-radius: 10px; padding: .7em 1em; font-weight: 500; }
.ok { background: var(--green-bg); color: var(--green); border-radius: 10px; padding: .8em 1em; font-weight: 500; }

/* result */
.page-title { margin-bottom: 20px; }
.result { margin-bottom: 20px; }
.result h2 { font-size: 1.6rem; border-bottom: 2px solid var(--saffron); padding-bottom: .35em; }
.kv { width: 100%; border-collapse: collapse; }
.kv th, .kv td { text-align: left; padding: .7em .4em; border-bottom: 1px solid var(--line); vertical-align: top; }
.kv tr:last-child th, .kv tr:last-child td { border-bottom: 0; }
.kv th { width: 42%; color: var(--muted); font-weight: 500; }
.kv td { font-weight: 600; font-size: 1.05rem; }
.st { display: inline-block; padding: .15em .8em; border-radius: 999px; background: #f3ece2; }
.st-pass { background: var(--green-bg); color: var(--green); }
.st-fail { background: var(--red-bg); color: var(--red); }
.st-pending { background: #fdf1dc; color: #8a5a00; }
.st { font-size: .85rem; font-weight: 600; white-space: nowrap; }

.comp { width: 100%; border-collapse: collapse; margin-top: 18px; }
.comp thead th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  font-weight: 600; padding: .5em .4em; border-bottom: 2px solid var(--line); }
.comp tbody th, .comp td { padding: .8em .4em; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.comp tbody th { font-weight: 600; }
.comp tbody th small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.comp .marks { white-space: nowrap; font-size: 1.05rem; }
.comp .status { text-align: right; }
.comp thead th:last-child { text-align: right; }

.overall { margin: 18px 0 8px; border-radius: 12px; padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 8px 32px; }
.overall span { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; opacity: .8; }
.overall strong { font-size: 1.35rem; }
.overall p { margin: 0; flex-basis: 100%; font-size: .9rem; }
.ov-pass { background: var(--green-bg); color: var(--green); }
.ov-fail { background: var(--red-bg); color: var(--red); }
.ov-pending { background: #fdf1dc; color: #6b4600; }

/* admin */
.admin { max-width: 1080px; }
.admin .card { margin-bottom: 20px; }
.admin h1 { font-size: 2.2rem; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.narrow-card { max-width: 440px; margin: 0 auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.chip { text-decoration: none; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: .35em .9em; font-size: .88rem; }
.chip-on { background: var(--maroon); color: #fff; border-color: var(--maroon); }
.search { display: flex; gap: 8px; margin-bottom: 16px; }
.search input { margin: 0; }
.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.list { width: 100%; border-collapse: collapse; min-width: 640px; }
.list th, .list td { text-align: left; padding: .7em .8em; border-bottom: 1px solid var(--line); vertical-align: top; }
.list thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.list a { text-decoration: none; }
.pw { display: inline-block; border-radius: 6px; padding: .1em .5em; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.pw-default { background: #fdf1dc; color: #6b4600; }
.pw-dob { background: var(--green-bg); color: var(--green); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 20px; margin-bottom: 16px; }
.grid2 small { display: block; font-weight: 400; margin-top: 4px; }
select { display: block; width: 100%; margin-top: 6px; padding: .7em .9em; font: inherit; border: 1px solid #d9cbb6; border-radius: 10px; background: #fff; }
.pw-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; margin: 0; }
.btn-outline { background: transparent; color: var(--maroon) !important; border: 1.5px solid var(--maroon); }
.btn-outline:hover { background: var(--maroon); color: #fff !important; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #8c1c16; }
.danger { color: var(--red); margin-top: 10px; font-size: .9rem; }
.danger-zone { border-color: #f1c4bf; }

/* footer */
.foot { border-top: 1px solid var(--line); background: var(--paper); padding: 20px 0; font-size: .9rem; }
.foot p { margin: .2em 0; }

@media (max-width: 560px) {
  .brand small { display: none; }
  .brand strong { font-size: .95rem; line-height: 1.2; }
  nav { gap: 12px; white-space: nowrap; font-size: .92rem; }
  nav a[href="/#courses"] { display: none; }
  .hero { padding-top: 36px; }
  .notice .btn { width: 100%; text-align: center; }
  .kv th { width: 45%; }
}
@media print {
  .top nav, .foot { display: none; }
  .card { box-shadow: none; }
}
