/* =========================================================================
   Sistem Asesmen Rekrutmen — design tokens
   Arah desain: "instrumen ukur / ledger". Tenang, presisi, kredibel.
   Aksen amber = nilai/aset. Monospace = readout (timer, skor, status).
   ========================================================================= */

:root {
  --ink:        #14181f;
  --ink-soft:   #2b313b;
  --paper:      #eef0ec;
  --paper-2:    #f6f7f4;
  --line:       #d4d8cf;
  --line-soft:  #e2e5dd;
  --muted:      #5c6258;
  --amber:      #b8741a;
  --amber-deep: #93590f;
  --green:      #2e6b4f;
  --red:        #ad3326;

  --r:   10px;
  --r-s: 6px;
  --gap: 20px;

  --shadow: 0 1px 2px rgba(20,24,31,.04), 0 8px 24px rgba(20,24,31,.06);

  --ff-display: "Bricolage Grotesque", system-ui, sans-serif;
  --ff-body:    "Inter", system-ui, sans-serif;
  --ff-mono:    "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--ff-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--ff-display); font-weight: 700; line-height: 1.1; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 .6em; }
a  { color: var(--amber-deep); }

.mono { font-family: var(--ff-mono); }
.muted { color: var(--muted); }
.eyebrow {
  font-family: var(--ff-mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin: 0 0 .5rem;
}

/* ---- layout shells ---- */
.shell { max-width: 880px; margin: 0 auto; padding: 32px 20px 80px; }
.shell-wide { max-width: 1120px; }

.brandbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}
.brandbar .logo {
  font-family: var(--ff-display); font-weight: 800; font-size: 1.05rem;
  display: flex; align-items: center; gap: 10px;
}
.brandbar .logo .dot {
  width: 10px; height: 10px; border-radius: 3px; background: var(--amber);
  box-shadow: 0 0 0 4px rgba(184,116,26,.16);
}
.brandbar .who { font-family: var(--ff-mono); font-size: .8rem; color: var(--muted); }

/* ---- card ---- */
.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: var(--gap); }

/* ---- forms ---- */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: .82rem; font-weight: 600;
  margin-bottom: 6px; color: var(--ink-soft);
}
.field .hint { font-size: .76rem; color: var(--muted); margin-top: 5px; }
input, textarea, select {
  width: 100%; font-family: var(--ff-body); font-size: .95rem;
  padding: 11px 13px; border: 1px solid var(--line);
  border-radius: var(--r-s); background: #fff; color: var(--ink);
}
textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(184,116,26,.18);
}
input[type=file] { padding: 9px; background: #fff; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--ff-body); font-weight: 600; font-size: .92rem;
  padding: 11px 20px; border-radius: var(--r-s); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .06s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-soft); }
.btn-amber { background: var(--amber); color: #fff; }
.btn-amber:hover { background: var(--amber-deep); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--paper); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---- alerts / status ---- */
.alert {
  border-radius: var(--r-s); padding: 11px 14px; font-size: .86rem;
  margin-bottom: 14px; border: 1px solid;
}
.alert-err  { background: #fbeeec; border-color: #e7c4be; color: var(--red); }
.alert-ok   { background: #ecf3ef; border-color: #bcd6c8; color: var(--green); }
.alert-info { background: #fff; border-color: var(--line); color: var(--ink-soft); }

.badge {
  font-family: var(--ff-mono); font-size: .68rem; letter-spacing: .06em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); display: inline-block;
}
.badge-ok   { color: var(--green); border-color: #bcd6c8; background: #ecf3ef; }
.badge-wait { color: var(--amber-deep); border-color: #e7d3b3; background: #f8f1e4; }
.badge-risk { color: var(--red); border-color: #e7c4be; background: #fbeeec; }

/* ---- auth split : Macan Gold brand ---- */
:root {
  --mg-gold:      #c89a4c;
  --mg-gold-deep: #a9802e;
  --mg-charcoal:  #15171a;
}

.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; background: var(--mg-charcoal); }

.auth-aside {
  position: relative;
  color: #fff; padding: 150px 48px 56px;
  display: flex; flex-direction: column; justify-content: flex-start;
  background-image:
    linear-gradient(180deg, rgba(8,9,11,.45) 0%, rgba(8,9,11,.15) 30%, rgba(9,10,12,.05) 50%, rgba(8,9,11,.50) 80%, rgba(6,7,8,.85) 100%),
    url("../assets/bg-macan-2.jpg");
  background-size: cover;
  background-position: center 30%;
}
.auth-aside .brandmark { position: absolute; top: 44px; left: 48px; display: flex; align-items: center; gap: 12px; }
.auth-aside .brandmark img { height: 74px; width: auto; filter: drop-shadow(0 2px 14px rgba(0,0,0,.65)); }

.auth-aside .copy { max-width: 27ch; }
.auth-aside .eyebrow { color: var(--mg-gold); letter-spacing: .16em; white-space: nowrap; }
.auth-aside h1 {
  color: #fff; font-size: clamp(2rem, 4vw, 2.85rem); margin: 6px 0 16px;
  letter-spacing: .01em; text-shadow: 0 2px 18px rgba(0,0,0,.55);
}
.auth-aside h1 .accent { color: var(--mg-gold); }
.auth-aside .sub {
  font-size: .96rem; color: #e2e3de; line-height: 1.65; max-width: 32ch;
  border-left: 2px solid var(--mg-gold); padding-left: 16px;
}

.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--paper-2); }
.auth-main .box { width: 100%; max-width: 380px; }
.auth-main .box-logo { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; margin-bottom: 32px; width: 100%; }
.auth-main .box-logo img { height: 90px; width: auto; display: block; margin: 0 auto; }
.auth-main .box-logo .name { display: block; width: 100%; font-family: var(--ff-display); font-weight: 700; font-size: 1.8rem; color: var(--ink); line-height: 1.15; text-align: center; }
.auth-main .box-logo .name small { display:block; font-family: var(--ff-mono); font-size: .85rem; letter-spacing: .12em; color: var(--mg-gold-deep); margin-top: 4px; text-align: center; }
.auth-main .box-logo .sub { font-family: var(--ff-display); font-style: italic; font-size: 1.05rem; color: var(--muted); margin-top: 6px; line-height: 1.6; max-width: 380px; text-align: center; }

.tabs { display: flex; gap: 4px; background: var(--paper); padding: 4px; border-radius: var(--r-s); margin-bottom: 22px; }
.tabs button {
  flex: 1; border: none; background: transparent; padding: 9px; border-radius: 5px;
  font-weight: 600; font-size: .88rem; cursor: pointer; color: var(--muted);
}
.tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

.auth-main .btn-amber { background: var(--mg-gold-deep); }
.auth-main .btn-amber:hover { background: #8a6a26; }
.auth-main input:focus, .auth-main textarea:focus, .auth-main select:focus {
  border-color: var(--mg-gold); box-shadow: 0 0 0 3px rgba(200,154,76,.22);
}
.auth-main #link-reset { color: var(--mg-gold-deep); }

@media (max-width: 760px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside {
    padding: 120px 24px 34px; min-height: 64vh;
    background-image:
      linear-gradient(180deg, rgba(8,9,11,.45) 0%, rgba(8,9,11,.15) 30%, rgba(9,10,12,.20) 50%, rgba(8,9,11,.65) 80%, rgba(6,7,8,.90) 100%),
      url("../assets/bg-macan-2.jpg");
  }
  .auth-aside .brandmark { top: 28px; left: 24px; }
  .auth-aside .brandmark img { height: 56px; }
}
@media (max-width: 420px) {
  .auth-aside h1 { font-size: 1.8rem; }
}

/* ---- progress steps ---- */
.steps { display: flex; gap: 8px; margin-bottom: 26px; flex-wrap: wrap; }
.step {
  font-family: var(--ff-mono); font-size: .72rem; letter-spacing: .04em;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted);
}
.step.done { color: var(--green); border-color: #bcd6c8; }
.step.now  { color: #fff; background: var(--ink); border-color: var(--ink); }

/* ---- test chrome ---- */
.test-body { background: var(--ink); color: #e7e9ec; }
.test-topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 22px; background: #0e1218; border-bottom: 1px solid #232a35;
}
.test-topbar .stage { font-family: var(--ff-mono); font-size: .78rem; color: #8b95a3; letter-spacing: .08em; }
.timer {
  font-family: var(--ff-mono); font-weight: 700; font-size: 1.35rem;
  letter-spacing: .04em; color: #fff;
}
.timer.warn { color: #f0a35a; }
.timer.crit { color: #ef6a59; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.strikes { font-family: var(--ff-mono); font-size: .74rem; color: #ef6a59; }

.test-stage { max-width: 760px; margin: 0 auto; padding: 34px 22px 120px; }
.q {
  background: #161c25; border: 1px solid #242c38; border-radius: var(--r);
  padding: 22px; margin-bottom: 16px;
}
.q .qnum { font-family: var(--ff-mono); font-size: .72rem; color: var(--amber); letter-spacing: .1em; }
.q .qtext { font-size: 1.02rem; margin: 8px 0 16px; color: #f1f3f6; }
.opt {
  display: flex; gap: 11px; align-items: flex-start; padding: 11px 14px;
  border: 1px solid #2a323e; border-radius: var(--r-s); margin-bottom: 8px;
  cursor: pointer; transition: border-color .12s, background .12s;
}
.opt:hover { border-color: #3c4654; background: #1b212b; }
.opt input { width: auto; margin-top: 3px; accent-color: var(--amber); }
.opt.sel { border-color: var(--amber); background: #1f2530; }
.q textarea { background: #0e1218; border-color: #2a323e; color: #eef0f3; }
.q textarea:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(184,116,26,.25); }
.test-footer {
  position: fixed; bottom: 0; left: 0; right: 0; padding: 14px 22px;
  background: #0e1218; border-top: 1px solid #232a35;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}

.overlay {
  position: fixed; inset: 0; background: rgba(8,11,16,.92); z-index: 50;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.overlay.show { display: flex; }
.overlay .panel {
  background: #161c25; border: 1px solid #2a323e; border-radius: var(--r);
  padding: 30px; max-width: 460px; text-align: center; color: #e7e9ec;
}
.overlay .panel h2 { color: #fff; margin-bottom: 10px; }

/* ---- admin table ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th {
  text-align: left; font-family: var(--ff-mono); font-size: .7rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  padding: 10px 12px; border-bottom: 2px solid var(--line);
}
.tbl td { padding: 13px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.tbl tr:hover td { background: var(--paper); }
.score { font-family: var(--ff-mono); font-weight: 600; }
.scorebar { height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; margin-top: 4px; }
.scorebar > i { display: block; height: 100%; background: var(--amber); }

.metric-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 8px 0 16px; }
.metric {
  border: 1px solid var(--line); border-radius: var(--r-s); padding: 14px; background: #fff;
}
.metric .lbl { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.metric .val { font-family: var(--ff-mono); font-size: 1.6rem; font-weight: 700; }

.summary-card {
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--amber);
  border-radius: var(--r-s); padding: 18px; font-size: .92rem; line-height: 1.6;
}

dialog {
  border: 1px solid var(--line); border-radius: var(--r); padding: 0; max-width: 620px; width: 92%;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
dialog::backdrop { background: rgba(20,24,31,.45); }
dialog .dlg-head { display:flex; justify-content:space-between; align-items:center; padding:18px 22px; border-bottom:1px solid var(--line); }
dialog .dlg-body { padding: 22px; }
dialog .x { background:none; border:none; font-size:1.4rem; cursor:pointer; color:var(--muted); line-height:1; }

.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 620px) { .metric-grid { grid-template-columns: 1fr; } .shell { padding-top: 22px; } }
