/* =========================================================
   CodeNova Academy — gaya bersama untuk semua halaman
   Ubah warna/font brand cukup di :root di bawah ini.
   ========================================================= */

:root {
  /* Palet brand CodeNova */
  --coral: #FF7F50;        /* tombol utama & aksen hangat */
  --coral-dark: #E5673B;   /* bayangan tombol coral */
  --coral-soft: #FFE9E0;
  --sun: #FFD166;          /* badge, sorotan */
  --sun-dark: #E8B54A;
  --sun-soft: #FFF5DC;
  --mint: #06D6A0;         /* berhasil, dipilih */
  --mint-dark: #05B386;
  --mint-ink: #04775A;     /* teks hijau yang tetap mudah dibaca */
  --mint-soft: #DEF8EF;
  --sea: #118AB2;          /* biru laut: progress, fokus */
  --sea-dark: #0C6D8E;     /* tautan & latar dengan teks putih */
  --sea-soft: #E4F3F8;
  --sea-line: #BFE0EC;

  /* Netral */
  --ink: #073B4C;          /* judul & teks di atas warna palet */
  --text: #1F3440;         /* teks isi */
  --muted: #52646D;
  --paper: #FFFAF3;        /* latar halaman krem hangat */
  --soft: #FFF6EA;         /* kotak info di dalam panel putih */
  --line: #EADFD0;
  --bar: #F0E8DC;          /* jalur meter & progress */
  --danger: #C0392B;

  /* Bentuk */
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;

  /* Tipografi */
  --font-display: "Baloo 2", "Poppins", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-code: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Pola titik & garis empat warna */
  --dots: radial-gradient(rgba(17, 138, 178, .16) 1.2px, transparent 1.2px);
  --stripe: linear-gradient(90deg, var(--coral) 0 25%, var(--sun) 25% 50%, var(--mint) 50% 75%, var(--sea) 75% 100%);
}

/* ---------- Reset ringan ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* elemen tersembunyi tetap tersembunyi walau punya gaya display */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
}
h1, h2, h3, h4 {
  margin: 0 0 .5em;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  color: var(--ink);
}
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
a { color: var(--sea-dark); }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--sea); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

.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;
}
.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  background: #fff; color: var(--ink); padding: .6rem 1rem; box-shadow: 0 4px 12px rgba(7, 59, 76, .15);
  border-radius: var(--radius-sm); font-weight: 700;
}
.skip-link:focus { top: 1rem; }

.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }

/* ---------- Tombol ----------
   Tombol "mainan" dengan bayangan tegas di bawah: terasa bisa ditekan. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 50px; padding: .75em 1.5em;
  border: 2px solid transparent; border-radius: 999px;
  font: 700 1rem/1.2 var(--font-body);
  text-decoration: none; text-align: center; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background-color .15s ease;
}
.btn:active { transform: translateY(3px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--coral); color: var(--ink); box-shadow: 0 5px 0 var(--coral-dark); }
.btn-primary:hover { background: #FF8C62; }
.btn-primary:active { box-shadow: 0 2px 0 var(--coral-dark); }

.btn-secondary { background: #fff; color: var(--ink); border-color: var(--sea-line); box-shadow: 0 5px 0 var(--sea-line); }
.btn-secondary:active { box-shadow: 0 2px 0 var(--sea-line); }

.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--sea); background: var(--sea-soft); }

.btn-ghost { background: rgba(255, 255, 255, .6); color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: #fff; }

.btn-sm { min-height: 42px; padding: .5em 1.1em; font-size: .95rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .9rem; }

.link-button { margin-top: .75rem; background: none; border: 0; padding: .4rem 0; color: var(--sea-dark); font-weight: 700; cursor: pointer; text-decoration: underline; }
.link-button:disabled { opacity: .5; cursor: not-allowed; }
.link-arrow { font-weight: 700; text-decoration: none; }
.link-arrow:hover { text-decoration: underline; }

/* ---------- Logo ---------- */
.logo {
  font-family: var(--font-display); font-weight: 800; font-size: 1.75rem; line-height: 1;
  color: var(--ink); text-decoration: none; white-space: nowrap;
  display: inline-flex; flex-direction: column; align-items: flex-start;
}
.logo .nova { color: var(--coral); }
.logo-by {
  margin-top: .25rem; padding-left: .1rem;
  font-family: var(--font-body); font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  color: var(--muted);
}

/* ---------- Header situs ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 250, 243, .94); color: var(--ink);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px; background: var(--stripe); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.nav-menu { display: flex; align-items: center; gap: .2rem; }
.nav-menu a:not(.btn) {
  color: var(--text); text-decoration: none; font-weight: 600;
  padding: .5rem .8rem; border-radius: 10px;
}
.nav-menu a:not(.btn):hover,
.nav-menu a[aria-current="page"] { color: var(--ink); background: var(--sea-soft); }
.nav-menu .btn { margin-left: .6rem; box-shadow: 0 4px 0 var(--coral-dark); }

.nav-toggle {
  display: none; width: 48px; height: 48px; align-items: center; justify-content: center;
  background: #fff; color: var(--ink); cursor: pointer;
  border: 2px solid var(--line); border-radius: 12px;
}
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after {
  display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px;
  position: relative; transition: transform .2s ease;
}
.nav-toggle .bars::before, .nav-toggle .bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle .bars::before { top: -6px; }
.nav-toggle .bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }
  .nav-menu {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: .25rem;
    padding: 1rem 1.25rem 1.5rem; background: var(--paper);
    border-bottom: 1px solid var(--line); box-shadow: 0 16px 24px -16px rgba(7, 59, 76, .25);
  }
  .nav-menu.is-open { display: flex; }
  .nav-menu a:not(.btn) { padding: .8rem 1rem; }
  .nav-menu .btn { margin: .5rem 0 0; }
  /* Tanpa JavaScript, menu tetap terlihat */
  .no-js .nav-toggle { display: none; }
  .no-js .nav-menu { display: flex; position: static; padding: 0 0 1rem; }
  .no-js .nav { flex-wrap: wrap; }
}

/* ---------- Section umum ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-white { background: #fff; }
.section-head { max-width: 640px; margin-bottom: 2.5rem; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); }
.lead { font-size: 1.15rem; color: var(--muted); }

/* Hero halaman dalam */
.page-hero {
  background-color: var(--sea-soft); background-image: var(--dots); background-size: 26px 26px;
  color: var(--text); padding: clamp(3rem, 7vw, 5rem) 0 clamp(3.5rem, 8vw, 5.5rem);
}
.page-hero h1 { color: var(--ink); font-size: clamp(2.2rem, 5.2vw, 3.5rem); max-width: 20ch; }
.page-hero .lead { color: var(--text); max-width: 58ch; }
.page-hero .hero-emoji { font-size: 3.25rem; line-height: 1; margin-bottom: 1rem; }
.page-hero .btn-row { margin-top: 2rem; }

/* Daftar centang */
.check-list { list-style: none; display: grid; gap: .7rem; }
.check-list li { position: relative; padding-left: 2.1rem; }
.check-list li::before {
  content: "✓"; position: absolute; left: 0; top: .15em;
  width: 1.45rem; height: 1.45rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--mint-soft); color: var(--mint-ink); font-weight: 800; font-size: .85rem;
}

/* Pita ajakan (CTA) */
.cta-band {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1.5rem 3rem;
  padding: clamp(2rem, 5vw, 3.25rem); border-radius: var(--radius-lg);
  background-color: var(--sea-dark); background-image: radial-gradient(rgba(255, 255, 255, .12) 1.2px, transparent 1.2px); background-size: 26px 26px;
  color: #EAF6FA;
}
.cta-band h2 { color: #fff; font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
.cta-band .btn-row { justify-content: flex-end; }
@media (max-width: 760px) {
  .cta-band { grid-template-columns: 1fr; }
  .cta-band .btn-row { justify-content: flex-start; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #CFE3EA; padding: 3.5rem 0 2rem; }
.site-footer .logo { color: #fff; }
.site-footer .logo-by { color: #CFE3EA; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer-grid p { max-width: 36ch; margin-top: 1rem; }
.footer-title { font-family: var(--font-body); font-size: 1rem; color: #fff; margin-bottom: .8rem; }
.footer-links { list-style: none; display: grid; gap: .4rem; }
.footer-links a { color: #E6F4F8; text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-copy { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, .15); font-size: .9rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* Tombol WhatsApp melayang */
.wa-float {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 40;
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .8rem 1.15rem .8rem .95rem; border-radius: 999px;
  background: var(--mint); color: var(--ink); font-weight: 700; text-decoration: none;
  box-shadow: 0 5px 0 var(--mint-dark), 0 14px 30px rgba(7, 59, 76, .18);
}
.wa-float svg { width: 24px; height: 24px; flex: none; }
.wa-float:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--mint-dark); }
@media (max-width: 520px) {
  .wa-float { padding: .9rem; }
  .wa-float span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* =========================================================
   Halaman alur test (placement, data siswa, kuis, hasil, dll)
   ========================================================= */
.flow-page {
  min-height: 100vh; display: flex; flex-direction: column;
  background-color: var(--sea-soft); background-image: var(--dots); background-size: 26px 26px;
  border-top: 6px solid transparent; border-image: var(--stripe) 1;
}
.flow-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.25rem clamp(1.25rem, 4vw, 2.5rem);
}
.flow-exit { color: var(--sea-dark); font-weight: 600; text-decoration: none; font-size: .95rem; white-space: nowrap; }
.flow-exit:hover { color: var(--ink); text-decoration: underline; }
.flow-main { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: .5rem 1rem 3.5rem; }

.panel {
  width: 100%; max-width: 720px; background: #fff; border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 5vw, 3rem);
  border: 1px solid var(--sea-line);
  box-shadow: 0 24px 50px -28px rgba(7, 59, 76, .35);
}
.panel-wide { max-width: 1000px; }
.panel-head { text-align: center; margin-bottom: 2rem; }
.panel-head h1 { font-size: clamp(1.9rem, 4.6vw, 2.6rem); }
.panel-head .lead { max-width: 52ch; margin-inline: auto; }
.panel-emoji { font-size: 3.75rem; line-height: 1; margin-bottom: .75rem; }
.step-label {
  display: inline-block; margin-bottom: .8rem; padding: .3rem .85rem; border-radius: 999px;
  background: var(--sea-soft); color: var(--sea-dark); font-weight: 700; font-size: .9rem;
}

.box { background: var(--soft); border-radius: var(--radius-md); padding: 1.25rem 1.4rem; }
.box-green { background: var(--mint-soft); color: var(--text); }
.box-sun { background: var(--sun-soft); color: var(--text); }
.box h2, .box h3 { font-size: 1.3rem; }
.box-green h2, .box-green h3 { color: var(--ink); }
.box-sun h2, .box-sun h3 { color: var(--ink); }
.stack > * + * { margin-top: 1.25rem; }

.center { text-align: center; }
.back-link { display: inline-block; margin-top: 1.25rem; font-weight: 700; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

.empty-state { text-align: center; padding: 1rem 0; }
.empty-state .btn { margin-top: 1.25rem; }

/* ---------- Form ---------- */
.field { margin-bottom: 1.25rem; }
.field > label, fieldset > legend { display: block; margin-bottom: .45rem; font-weight: 700; color: var(--text); }
.optional { font-weight: 500; color: var(--muted); }
.input {
  width: 100%; min-height: 52px; padding: .75rem 1rem;
  border: 2px solid var(--line); border-radius: 14px; background: #fff;
  font: inherit; color: var(--text);
}
.input:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 4px rgba(17, 138, 178, .22); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; min-width: 0; }
.form-section-title {
  font-size: 1.25rem; margin: 2rem 0 1rem; padding-top: 1.75rem; border-top: 2px dashed var(--line);
}
.error-text { display: none; margin-top: .4rem; color: var(--danger); font-size: .92rem; font-weight: 600; }
.has-error .error-text { display: block; }
.has-error .input { border-color: var(--danger); }
.has-error .choice span { border-color: #F2A79D; }

.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.choice { position: relative; display: block; }
.choice input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.choice span {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 58px; padding: .7rem .8rem; text-align: center;
  border: 2px solid var(--line); border-radius: 14px; background: #FFFDF9;
  font-weight: 600; transition: background-color .15s ease, border-color .15s ease;
}
.choice:hover span { border-color: var(--sea); }
.choice input:checked + span { background: var(--mint-soft); border-color: var(--mint-dark); color: var(--ink); }
.choice input:focus-visible + span { outline: 3px solid var(--sea); outline-offset: 2px; }

@media (max-width: 560px) {
  .choice-grid, .field-row { grid-template-columns: 1fr; }
}

/* ---------- Meter skill (dipakai di hasil, laporan, dashboard) ---------- */
.meters { display: grid; gap: .9rem; }
.meter-top { display: flex; justify-content: space-between; gap: 1rem; font-weight: 600; font-size: .95rem; }
.meter-top span:last-child { color: var(--muted); font-weight: 500; }
.meter-track { height: 12px; margin-top: .35rem; border-radius: 999px; background: var(--bar); overflow: hidden; }
.meter-fill { height: 100%; border-radius: inherit; background: var(--sea); width: 0; transition: width .6s ease; }
.meter-fill.is-strong { background: var(--mint-dark); }
.meter-fill.is-interest { background: var(--coral); }

/* ---------- Papan robot (beranda & Placement Test) ---------- */
.lab-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  margin: 1rem 0; padding: 8px; border-radius: var(--radius-md); background: var(--sea-soft);
}
.lab-cell {
  aspect-ratio: 1; border-radius: 10px; background: #fff;
  display: grid; place-items: center; position: relative;
  font-size: clamp(1.4rem, 4.2vw, 2rem); line-height: 1;
}
.lab-cell.is-path { background: var(--mint-soft); }
.lab-cell.is-crash { background: var(--coral-soft); }
.lab-robot { position: relative; display: grid; place-items: center; }
.lab-dir {
  position: absolute; width: 0; height: 0; top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg)) translateY(-1.05em);
}
.lab-dir::before {
  content: ""; position: absolute; left: -7px; top: -8px;
  border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 10px solid var(--sea);
}

.lab-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.lab-cmd {
  min-height: 48px; border: 2px solid var(--sea-line); border-radius: 12px; background: var(--sea-soft);
  color: var(--ink); font-weight: 700; cursor: pointer; box-shadow: 0 3px 0 var(--sea-line);
  transition: transform .1s ease;
}
.lab-cmd:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--sea-line); }
.lab-cmd:disabled { opacity: .5; cursor: not-allowed; }

.lab-program {
  list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; align-content: flex-start;
  min-height: 58px; margin: .9rem 0; padding: .6rem; border-radius: 12px;
  border: 2px dashed var(--line); counter-reset: cmd;
}
.lab-program:empty::before { content: "Belum ada perintah"; color: var(--muted); font-size: .92rem; align-self: center; padding-left: .25rem; }
.lab-program button {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .3rem .6rem; border-radius: 8px; border: 0; cursor: pointer;
  background: var(--ink); color: #fff; font-size: .85rem; font-weight: 600;
}
.lab-program button::before { counter-increment: cmd; content: counter(cmd); color: var(--sun); font-weight: 800; }
.lab-program button.is-active { background: var(--mint-ink); }
.lab-program button:hover { background: var(--danger); }

.lab-actions { display: grid; grid-template-columns: 1fr auto; gap: .6rem; }
.lab-status { margin-top: .9rem; min-height: 1.6em; font-weight: 600; color: var(--muted); }
.lab-status.is-win { color: var(--mint-ink); }
.lab-status.is-fail { color: var(--danger); }
.lab-status a { color: var(--mint-ink); }

@media print {
  .site-header, .site-footer, .wa-float, .flow-header, .no-print { display: none !important; }
  .flow-page { background: #fff; }
  .panel { box-shadow: none; padding: 0; max-width: none; }
  .meter-fill { -webkit-print-color-adjust: exact; print-color-adjust: exact; transition: none; }
}

@media (max-width: 420px) {
  .flow-header { padding: 1rem; }
  .flow-header .logo { font-size: 1.45rem; }
  .flow-exit { font-size: .85rem; }
}
