/* AMEA Math — area belajar (belajar.ameamath.com)
   Gagasan: buku kerja. Menu jenjang di kiri (atas di ponsel), isi di kanan, kertas berpetak di halaman masuk. */
:root {
  --tinta: #0F1D45;
  --kertas: #FBFCFF;
  --garis: #E3EAF7;
  --batas: #DDE3EF;
  --redup: #4E5A78;
  --sorot: #E8EEFB;
  --biru: #1E6FE8;
  --galat: #B42318;
  --galat-latar: #FDECEC;
  --ok: #0B7D39;
  --ok-latar: #E2F6EA;
  --tampil: 'Montserrat', 'Avenir Next', 'Segoe UI', Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* layar sangat lebar: isi ikut membesar (16 px di 1440 px, maksimal 22 px) */
@media (min-width: 1440px) {
  html { font-size: clamp(100%, 0.375rem + 0.65vw, 137.5%); }
}
body {
  margin: 0; min-height: 100vh;
  background: var(--kertas); color: var(--tinta);
  font-family: var(--tampil); font-size: 1rem; font-weight: 500; line-height: 1.6;
}
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--biru); outline-offset: 3px; border-radius: 4px; }

.lompat {
  position: absolute; left: 16px; top: -80px; z-index: 10;
  padding: 10px 16px; border-radius: 8px; background: var(--tinta); color: #fff; font-weight: 700;
}
.lompat:focus { top: 16px; }

h1 { font-size: clamp(1.7rem, 1.6vw + 1.2rem, 2.3rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; font-weight: 800; line-height: 1.3; }
.pengantar { margin-top: 6px; color: var(--redup); }

.tombol {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: 0 1.125rem;
  border: 2px solid var(--tinta); border-radius: 10px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.tombol-utama { background: var(--tinta); color: #fff; }
.tombol-utama:hover { background: #1C3170; border-color: #1C3170; }
.tombol-garis { background: #fff; color: var(--tinta); }
.tombol-garis:hover { background: var(--sorot); }

/* ---------- halaman masuk ---------- */
body.luar {
  background-image:
    linear-gradient(var(--garis) 1px, transparent 1px),
    linear-gradient(90deg, var(--garis) 1px, transparent 1px);
  background-size: 32px 32px;
}
.masuk { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; }
.masuk-kartu {
  width: min(26.25rem, 100%);
  display: grid; gap: 18px;
  padding: clamp(24px, 5vw, 40px);
  background: #fff; border: 2px solid var(--tinta); border-radius: 16px;
}
.masuk-logo img { height: 1.875rem; width: auto; }
.masuk-kartu h1 { margin-top: 10px; }
.masuk-kartu .pengantar { margin-top: -12px; }
.formulir { display: grid; gap: 16px; }
.isian { display: grid; gap: 6px; }
.isian label { font-weight: 700; }
.isian input {
  width: 100%; min-height: 3rem; padding: 0 14px;
  border: 2px solid #B9C3DD; border-radius: 10px; background: #fff;
  font: inherit; color: var(--tinta);
}
.isian input:focus { border-color: var(--biru); outline: none; box-shadow: 0 0 0 3px #CFE0FF; }
.sandi { position: relative; }
.sandi input { padding-right: 7.25rem; }
.lihat {
  position: absolute; right: 4px; top: 4px; bottom: 4px;
  min-width: 6.5rem; padding: 0 12px;
  border: 0; border-radius: 7px; background: var(--sorot); color: var(--tinta);
  font: inherit; font-size: 0.92rem; font-weight: 700; cursor: pointer;
}
.lihat:hover { background: #DCE6FA; }
.formulir .tombol-utama { min-height: 3.125rem; margin-top: 4px; }
.pesan { padding: 12px 14px; border-radius: 10px; font-weight: 600; }
.pesan-galat { background: var(--galat-latar); color: var(--galat); }
.pesan-ok { background: var(--ok-latar); color: var(--ok); }
.kembali { justify-self: start; color: var(--redup); font-size: 0.95rem; text-underline-offset: 3px; }
.kembali:hover { color: var(--tinta); }

/* ---------- di dalam ---------- */
.atas {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px clamp(16px, 3vw, 32px);
  background: #fff; border-bottom: 1px solid var(--batas);
}
.atas-logo img { height: 1.75rem; width: auto; }
.atas-akun { display: flex; align-items: center; gap: 12px; }
.akun-nama {
  padding: 6px 12px; border-radius: 99px; background: var(--sorot);
  font-size: 0.92rem; font-weight: 700; letter-spacing: 0.02em;
}
.atas-akun form { margin: 0; }

.rangka { display: grid; grid-template-columns: minmax(0, 1fr); }
.menu {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 12px clamp(16px, 3vw, 32px);
  background: #fff; border-bottom: 1px solid var(--batas);
}
.menu a {
  flex: none; display: flex; align-items: center; gap: 10px;
  min-height: 2.75rem; padding: 6px 12px; border-radius: 10px;
  font-weight: 600; text-decoration: none; white-space: nowrap;
}
.menu a:hover { background: var(--sorot); }
.menu a[aria-current="page"] { background: var(--sorot); font-weight: 800; }
.menu img { width: 1.75rem; height: 1.75rem; flex: none; }

.isi { padding: clamp(24px, 4vw, 3rem) clamp(16px, 4vw, 3.5rem) 4rem; max-width: 61.25rem; }

@media (min-width: 900px) {
  .rangka { grid-template-columns: 16.5rem minmax(0, 1fr); min-height: calc(100vh - 4.3rem); }
  .menu {
    flex-direction: column; overflow: visible;
    padding: 24px 16px; border-bottom: 0; border-right: 1px solid var(--batas);
  }
}

/* beranda */
.kartu-jenjang { display: grid; gap: 16px; margin-top: 28px; }
.kartu-jenjang a {
  display: flex; align-items: center; gap: 20px;
  padding: 18px 20px; border: 2px solid var(--batas); border-radius: 14px; background: #fff;
  text-decoration: none;
}
.kartu-jenjang a:hover { border-color: var(--tinta); }
.kartu-jenjang img { width: 4.5rem; height: 4.5rem; flex: none; }
.kartu-teks { display: grid; gap: 2px; justify-items: start; }
.kartu-nama { font-size: 1.15rem; font-weight: 800; }
.kartu-kelas { color: var(--redup); }
.status {
  margin-top: 6px; padding: 2px 10px; border-radius: 99px;
  background: #EEF1F6; color: var(--redup); font-size: 0.85rem; font-weight: 600;
}
@media (min-width: 640px) {
  .kartu-jenjang { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* halaman jenjang */
.judul-jenjang { display: flex; align-items: center; gap: 20px; }
.judul-jenjang img { width: 5.5rem; height: 5.5rem; flex: none; }
.bagian { margin-top: 36px; }
.bagian h2 { display: flex; align-items: center; gap: 12px; }
.bagian h2 img { width: 2.25rem; height: 2.25rem; }
.kosong {
  margin-top: 14px; padding: 22px 24px;
  border: 2px dashed #C3CDE3; border-radius: 14px; background: #fff;
}
.kosong p:first-child { font-weight: 700; }
.kosong p + p { margin-top: 2px; color: var(--redup); }
