/* ===== Variabel & Reset (Tema Indigo/Violet) ===== */
:root {
  --brand-900: #2e1065;
  --brand-800: #4c1d95;
  --brand-700: #5b21b6;
  --brand-600: #6d28d9;
  --brand-500: #7c3aed;
  --brand-400: #a855f7;
  --brand-300: #c4b5fd;
  --brand-200: #ddd2fb;
  --brand-100: #ede7ff;
  --brand-50:  #f5f1ff;

  --accent-600: #d97706;
  --accent-500: #f59e0b;
  --accent-100: #fef3c7;

  --success-700: #15803d;
  --success-600: #16a34a;
  --success-100: #d1fae5;
  --danger-700: #b91c1c;
  --danger-600: #dc2626;
  --danger-100: #fee2e2;

  --gray-950: #171223;
  --gray-900: #1f2430;
  --gray-700: #37304a;
  --gray-600: #6b7280;
  --gray-500: #7c748f;
  --gray-400: #b5aec6;
  --gray-300: #d6d0e2;
  --gray-200: #e6e2f7;
  --gray-100: #efebf9;
  --gray-50:  #f7f5ff;

  /* Tokens semantik */
  --primary: #6d28d9;
  --primary-dark: #5b21b6;
  --primary-light: #a855f7;
  --bg: #ffffff;
  --bg-soft: #f5f1ff;
  --sidebar-bg: #f5f1ff;
  --sidebar-hover: #ede7ff;
  --text: #211b30;
  --text-muted: #6b7280;
  --border: #e6e0f5;
  --code-bg: #241c38;
  --code-text: #ece7ff;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 999px;
  --radius-round: 50%;

  --shadow-sm: 0 1px 3px rgba(76, 29, 149, 0.08);
  --shadow: 0 2px 10px rgba(76, 29, 149, 0.12);
  --shadow-lg: 0 12px 32px rgba(76, 29, 149, 0.22);

  --gradient: linear-gradient(135deg, #4c1d95, #7c3aed 55%, #a855f7);
  --gradient-soft: linear-gradient(135deg, #6d28d9, #a855f7);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 60px; /* offset topbar fixed (60px) saat lompat ke jangkar */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
}

body.no-scroll {
  overflow: hidden;
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--gradient);
  color: #fff;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  box-shadow: 0 2px 14px rgba(76, 29, 149, 0.35);
}

.header-title {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* ===== Hamburger ===== */
.hamburger {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  margin-right: 1rem;
  padding: 6px;
  border-radius: 999px;
  color: #fff;
}

.hamburger svg {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.hamburger .icon-tutup {
  display: none;
}
.hamburger[aria-expanded="true"] .icon-buka {
  display: none;
}
.hamburger[aria-expanded="true"] .icon-tutup {
  display: block;
}

/* ===== Container ===== */
.container {
  display: flex;
  margin-top: 60px;
  min-height: calc(100vh - 60px);
}

/* ===== Sidebar ===== */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  height: calc(100vh - 60px);
  position: sticky;
  top: 60px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 0.5rem;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem 1rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

/* ===== Tombol collapse/expand sidebar ===== */
.sidebar-collapse-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--sidebar-hover);
  color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.28s ease;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-collapse-btn:hover {
  background: var(--brand-100);
  border-color: var(--primary-light);
  color: var(--primary-dark);
}
.sidebar-collapse-btn:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}
.sidebar-collapse-btn svg {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.sidebar-collapse-btn .icon-buka {
  display: none;
}
.sidebar.collapsed .sidebar-collapse-btn .icon-tutup {
  display: none;
}
.sidebar.collapsed .sidebar-collapse-btn .icon-buka {
  display: block;
}

/* ===== Mode collapsed (desktop): hanya ikon ===== */
.sidebar.collapsed {
  overflow-x: hidden;
}
.sidebar.collapsed .sidebar-brand {
  justify-content: center;
  padding: 0.5rem 0 1rem;
}
.sidebar.collapsed .sidebar-collapse-btn {
  margin-left: 0;
}
.sidebar.collapsed .brand-text {
  display: none;
}
.sidebar.collapsed .nav-link,
.sidebar.collapsed .nav-link-row .nav-link {
  justify-content: center;
  gap: 0;
  padding-left: 0;
  padding-right: 0;
}
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-chevron {
  display: none;
}
.sidebar.collapsed .nav-num {
  width: 30px;
  height: 30px;
  font-size: 0.85rem;
}
.sidebar.collapsed .nav-sublist {
  display: none !important;
}

.nav-list {
  list-style: none;
  min-width: 0;
}

.nav-item {
  margin-bottom: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 999px;
  font-weight: 500;
  min-width: 0;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--sidebar-hover);
  color: var(--primary-dark);
}

.nav-link.active {
  background: var(--gradient-soft);
  color: #fff;
}

.nav-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.nav-link.active .nav-num,
.nav-link.current .nav-num {
  background: #fff;
  color: var(--primary);
}

.nav-sublist {
  list-style: none;
  margin-left: 2.2rem;
  margin-top: 0.15rem;
  min-width: 0;
}

.nav-sublink {
  display: block;
  padding: 0.35rem 0.6rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s;
}

.nav-sublink:hover {
  color: var(--primary);
  border-left-color: var(--primary);
}

.nav-sublink.active {
  color: var(--primary);
  border-left-color: var(--primary);
  background: var(--sidebar-hover);
  font-weight: 600;
}

/* ===== Nav accordion (dropdown modul) ===== */
.nav-link-row {
  display: flex;
  align-items: center;
}
.nav-link-row .nav-link {
  flex: 1 1 auto;
  min-width: 0;
  gap: 0.5rem;
  padding-right: 0.25rem;
}
.nav-chevron svg {
  display: block;
}
.nav-chevron {
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  line-height: 1;
  color: var(--primary);
  background: var(--sidebar-hover);
  border: 1px solid var(--border);
  border-radius: 50%;
  transition: transform 0.25s ease, background 0.2s, color 0.2s, border-color 0.2s;
}
.nav-link-row .nav-link:hover .nav-chevron {
  background: var(--brand-100);
  border-color: var(--primary-light);
  color: var(--primary-dark);
}
.nav-link.active .nav-chevron,
.nav-link.current .nav-chevron {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}
.nav-link.active:hover .nav-chevron,
.nav-link.current:hover .nav-chevron {
  background: rgba(255, 255, 255, 0.32);
}
.nav-item:has(> .nav-sublist) > .nav-sublist {
  display: none;
}
.nav-item.open:has(> .nav-sublist) > .nav-sublist {
  display: block;
}
.nav-item.open .nav-chevron {
  transform: rotate(180deg);
  background: var(--gradient-soft);
  border-color: transparent;
  color: #fff;
}

/* Area sentuh lebih besar pada perangkat sentuh */
@media (pointer: coarse) {
  .nav-chevron {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }
}

/* ===== Content ===== */
.content {
  flex: 1;
  padding: 3rem 2.5rem;
  max-width: 960px;
  min-width: 0;
}

/* Saat sidebar di-ciutkan (narrow), canvas melebar agar konten lebih luas */
.sidebar.collapsed ~ .content {
  max-width: 1400px;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--gradient);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-lg);
}

.hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -70px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  position: relative;
}

.hero p {
  opacity: 0.95;
  margin-bottom: 1.5rem;
  max-width: 80%;
  position: relative;
}

.hero-cards {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  position: relative;
}

.hero-card {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  text-align: center;
  min-width: 120px;
  backdrop-filter: blur(4px);
}

.hero-card span {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
}

.hero-card p {
  font-size: 0.85rem;
  margin: 0;
  opacity: 0.9;
}

/* Module */
.module {
  margin-bottom: 4rem;
  padding-top: 2rem;
}

.module-title {
  font-size: 1.7rem;
  color: var(--text);
  border-bottom: 3px solid var(--primary);
  padding-bottom: 0.6rem;
  margin-bottom: 0.75rem;
}

.module-num {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.module-desc {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.sub {
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.sub h3 {
  font-size: 1.25rem;
  color: var(--primary-dark);
  margin-bottom: 1rem;
}

.sub h4 {
  font-size: 1.05rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--text);
}

.sub p {
  margin-bottom: 0.75rem;
}

.sub ul,
.sub ol {
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.sub li {
  margin-bottom: 0.35rem;
}

/* ===== Tabel ===== */
.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.92rem;
}

thead {
  background: var(--gradient-soft);
  color: #fff;
}

th, td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  vertical-align: top;
}

tbody tr:nth-child(even) {
  background: var(--bg-soft);
}

tbody tr:hover {
  background: var(--sidebar-hover);
}

/* ===== Code ===== */
code {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.9em;
}

code.blockcode {
  display: block;
  white-space: pre;
  padding: 0.9rem 1rem;
  margin: 0.75rem 0;
  line-height: 1.5;
  overflow-x: auto;
  font-size: 0.88rem;
}

/* ===== Note ===== */
.note {
  background: var(--accent-100);
  border-left: 4px solid var(--accent-500);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1rem 0;
  font-size: 0.92rem;
  color: #7c5c10;
}

/* ===== Back to top ===== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: var(--gradient-soft);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s;
  z-index: 200;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  filter: brightness(1.1);
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== Overlay (mobile) ===== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(35, 20, 60, 0.55);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
}

/* ===== Nav current page ===== */
.nav-link.current {
  background: var(--gradient-soft);
  color: #fff;
}
.nav-link.current .nav-num {
  background: #fff;
  color: var(--primary);
}

/* ===== Daftar modul (index) ===== */
.daftar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.daftar-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.daftar-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.daftar-card > div {
  min-width: 0;
}
.daftar-num {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--gradient-soft);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.35);
}
.daftar-card strong {
  display: block;
}
.daftar-card p {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== Pagination prev/next ===== */
.pager-wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.pager {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
  transition: background 0.2s;
}
.pager:hover {
  background: var(--sidebar-hover);
  color: var(--primary-dark);
}

/* ===== Capaian & Tujuan Pembelajaran ===== */
.cp-block {
  margin: 0 0 1.5rem;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--primary);
  background: var(--bg-soft);
  border-radius: var(--radius-md);
}
.cp-title {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  color: var(--primary-dark);
}
.cp-block p {
  margin-bottom: 0.6rem;
  color: var(--text);
}
.tp-title {
  font-size: 0.95rem;
  margin: 0.75rem 0 0.4rem;
  color: var(--primary-dark);
}
.cp-block ul {
  margin: 0;
  padding-left: 1.4rem;
}
.cp-block li {
  margin-bottom: 0.35rem;
}

/* ===== Kuis Pilihan Ganda ===== */
.opsi {
  margin: 0.5rem 0 1rem;
}
.opsi-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0.8rem;
  margin-bottom: 0.45rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.opsi-item:hover {
  border-color: var(--primary-light);
  background: var(--bg-soft);
  transform: translateX(2px);
}
.opsi-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.opsi-item.checked {
  border-color: var(--primary);
  background: var(--brand-100);
}
.opsi-letter {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--sidebar-hover);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-dark);
}
.opsi-item.checked .opsi-letter {
  background: var(--gradient-soft);
  color: #fff;
}
.opsi-text {
  font-size: 0.95rem;
  line-height: 1.5;
}
.opsi-item.show-correct {
  border-color: var(--success-600);
  background: #eefbf2;
}
.opsi-item.show-correct .opsi-letter {
  background: var(--success-600);
  color: #fff;
}
.opsi-item.wrong {
  border-color: var(--danger-600);
  background: #fdecec;
}
.opsi-item.wrong .opsi-letter {
  background: var(--danger-600);
  color: #fff;
}

.quiz-actions {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}
.quiz-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  min-height: 44px;
  border: none;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.quiz-btn svg.lucide { width: 1.15em; height: 1.15em; flex-shrink: 0; }
.quiz-btn-block svg.lucide { width: clamp(18px, 3.5vw, 21px); height: clamp(18px, 3.5vw, 21px); flex-shrink: 0; }
.quiz-btn:not(:disabled):hover {
  transform: translateY(-1px);
}
.quiz-btn-primary {
  background: var(--gradient-soft);
  color: #fff;
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.3);
}
.quiz-btn-primary:hover {
  filter: brightness(1.08);
}
.quiz-btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.quiz-btn-ghost:hover {
  background: var(--sidebar-hover);
}

.quiz-result {
  margin: 1rem 0;
  padding: 1.1rem 1.4rem;
  border-radius: var(--radius-lg);
  background: #eefbf2;
  border-left: 5px solid var(--success-600);
}
.quiz-result h3 {
  margin-bottom: 0.4rem;
  color: var(--success-700);
}
.quiz-score {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--success-700);
  margin: 0.3rem 0;
}
.quiz-hint {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}
.tag-correct {
  color: var(--success-600);
  font-weight: 700;
  font-style: normal;
}
.tag-wrong {
  color: var(--danger-600);
  font-weight: 700;
  font-style: normal;
}

/* ===== Login Siswa (Glassmorphism Mode) ===== */
.login-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #12082e 0%, #1e1145 35%, #3b1c7a 65%, #5b21b6 100%);
  padding: clamp(0.75rem, 2vh, 1.5rem);
  overflow: auto;
  animation: modalBgIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalBgIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.login-modal::before,
.login-modal::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(60px);
  animation: loginFloat 8s ease-in-out infinite;
}
.login-modal::before {
  width: clamp(260px, 40vw, 420px);
  height: clamp(260px, 40vw, 420px);
  background: radial-gradient(circle, rgba(168, 85, 247, 0.75) 0%, rgba(168, 85, 247, 0.3) 45%, transparent 70%);
  top: -80px;
  right: -60px;
}
.login-modal::after {
  width: clamp(220px, 34vw, 360px);
  height: clamp(220px, 34vw, 360px);
  background: radial-gradient(circle, rgba(16, 185, 129, 0.55) 0%, rgba(16, 185, 129, 0.18) 45%, transparent 70%);
  bottom: -70px;
  left: -60px;
  animation-delay: -4s;
}
@keyframes loginFloat {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  25% { transform: translate(10px, -15px) scale(1.03) rotate(2deg); }
  50% { transform: translate(-8px, 10px) scale(0.98) rotate(-1deg); }
  75% { transform: translate(12px, 5px) scale(1.02) rotate(1deg); }
}
.login-floating-shape {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.25;
}
.login-shape-1 {
  width: clamp(50px, 8vw, 80px);
  height: clamp(50px, 8vw, 80px);
  background: rgba(168, 85, 247, 0.35);
  top: 12%;
  left: 8%;
  animation: loginFloat 9s ease-in-out infinite;
  animation-delay: -1s;
}
.login-shape-2 {
  width: clamp(35px, 5vw, 50px);
  height: clamp(35px, 5vw, 50px);
  background: rgba(16, 185, 129, 0.35);
  top: 68%;
  right: 12%;
  animation: loginFloat 7s ease-in-out infinite;
  animation-delay: -3s;
}
.login-shape-3 {
  width: clamp(25px, 4vw, 35px);
  height: clamp(25px, 4vw, 35px);
  background: rgba(255, 255, 255, 0.15);
  bottom: 22%;
  left: 18%;
  animation: loginFloat 10s ease-in-out infinite;
  animation-delay: -5s;
}
.login-card {
  position: relative;
  isolation: isolate;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0.02) 100%);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  width: 100%;
  max-width: 420px;
  min-width: min(320px, 100%);
  border-radius: clamp(20px, 3vw, 28px);
  padding: clamp(1.5rem, 3vh, 2.5rem) clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 2.5vh, 2rem);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(109, 40, 217, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1);
  animation: cardSlideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s backwards;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  top: -40%;
  left: -30%;
  width: 80%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.12) 0%, transparent 65%);
  transform: rotate(-10deg);
  pointer-events: none;
  z-index: -1;
}
.login-card::after {
  content: "";
  position: absolute;
  bottom: -40%;
  right: -30%;
  width: 80%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(168, 85, 247, 0.18) 0%, transparent 65%);
  transform: rotate(10deg);
  pointer-events: none;
  z-index: -1;
}
@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(40px) scale(0.93); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-logo {
  width: clamp(60px, 10vw, 80px);
  height: clamp(60px, 10vw, 80px);
  margin: 0 auto clamp(1rem, 2vh, 1.5rem);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.1));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: clamp(16px, 2.5vw, 22px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: #ffffff;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  animation: logoPulse 3s ease-in-out infinite;
  position: relative;
}
.login-logo svg {
  filter: drop-shadow(0 2px 6px rgba(109, 40, 217, 0.5));
}
.login-logo::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.45) 0%, transparent 65%);
  opacity: 0.35;
  z-index: -1;
  animation: logoPulseRing 3s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@keyframes logoPulseRing {
  0%, 100% { transform: scale(1); opacity: 0.25; }
  50% { transform: scale(1.15); opacity: 0.1; }
}
.login-card h2 {
  text-align: center;
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
  animation: fadeInUp 0.5s ease 0.15s backwards;
}
.login-sub {
  text-align: center;
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  margin-bottom: clamp(1.25rem, 2.5vh, 1.75rem);
  animation: fadeInUp 0.5s ease 0.25s backwards;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-input-group {
  position: relative;
  margin-bottom: clamp(1rem, 2vh, 1.25rem);
  animation: fadeInUp 0.5s ease 0.35s backwards;
}
.login-input-group:focus-within .login-label {
  color: #ffffff;
}
.login-input-wrap {
  position: relative;
}
.login-input-icon {
  position: absolute;
  left: clamp(12px, 2.5vw, 16px);
  top: 50%;
  transform: translateY(-50%);
  width: clamp(18px, 3.5vw, 22px);
  height: clamp(18px, 3.5vw, 22px);
  max-width: 22px;
  max-height: 22px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.55);
  pointer-events: none;
  transition: color 0.2s ease, transform 0.2s ease;
}
.login-input-group:focus-within .login-input-icon {
  color: #ffffff;
  transform: translateY(-50%) scale(1.1);
}
.login-label {
  display: block;
  font-size: clamp(0.75rem, 1.5vw, 0.85rem);
  font-weight: 600;
  margin-bottom: clamp(0.3rem, 0.6vh, 0.5rem);
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.3px;
  transition: color 0.2s ease;
}
.login-input {
  width: 100%;
  padding: clamp(0.6rem, 1.2vh, 0.75rem) clamp(0.75rem, 1.5vw, 1rem)
           clamp(0.6rem, 1.2vh, 0.75rem) clamp(2.5rem, 5vw, 3rem);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  font-size: clamp(0.9rem, 1.8vw, 0.95rem);
  font-weight: 500;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  min-height: 46px;
}
.login-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
  font-weight: 400;
}
.login-input:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
}
.login-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.15);
}
.login-input.error {
  border-color: rgba(252, 165, 165, 0.8);
  background: rgba(239, 68, 68, 0.15);
}
.login-input.error:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}
.login-error {
  color: #fca5a5;
  font-size: clamp(0.75rem, 1.5vw, 0.82rem);
  margin: clamp(0.25rem, 0.5vh, 0.5rem) 0 clamp(0.5rem, 1vh, 0.75rem);
  padding-left: clamp(2px, 0.5vw, 4px);
  display: none;
  animation: shakeError 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
.login-error.show {
  display: block;
}
@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
.quiz-btn-block {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: clamp(170px, 40vw, 200px);
  margin-top: clamp(0.5rem, 1vh, 1rem);
  margin-inline: auto;
  padding: clamp(0.6rem, 1.3vh, 0.8rem) clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  font-size: clamp(0.9rem, 1.8vw, 0.98rem);
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 
    0 8px 24px rgba(16, 185, 129, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.5s ease 0.45s backwards;
  min-height: 48px;
  touch-action: manipulation;
}
.quiz-btn-block::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}
.quiz-btn-block:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 
    0 12px 32px rgba(16, 185, 129, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.15);
  filter: brightness(1.08);
}
.quiz-btn-block:hover:not(:disabled)::before {
  transform: translateX(100%);
}
.quiz-btn-block:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
  box-shadow: 
    0 4px 16px rgba(16, 185, 129, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}
.quiz-btn-block:focus-visible {
  outline: none;
  box-shadow: 
    0 0 0 4px rgba(16, 185, 129, 0.4),
    0 8px 24px rgba(16, 185, 129, 0.35);
}
.quiz-btn-block:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.3);
}
.quiz-btn-block .btn-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 1vw, 0.75rem);
}
.quiz-btn-block .btn-spinner {
  display: none;
  width: clamp(18px, 3.5vw, 22px);
  height: clamp(18px, 3.5vw, 22px);
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.quiz-btn-block.loading .btn-text { display: none; }
.quiz-btn-block.loading .btn-spinner { display: inline-block; }
@keyframes spin {
  to { transform: rotate(360deg); }
}
.login-support {
  display: block;
  text-align: center;
  margin-top: clamp(0.5rem, 1vh, 1rem);
  animation: fadeInUp 0.5s ease 0.55s backwards;
}
.login-link {
  font-size: clamp(0.75rem, 1.5vw, 0.85rem);
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}
.login-link:hover {
  color: #ffffff;
  text-decoration: underline;
}
.login-card .login-close {
  position: absolute;
  top: clamp(0.75rem, 1.5vh, 1rem);
  right: clamp(0.75rem, 1.5vw, 1rem);
  width: clamp(36px, 7vw, 44px);
  height: clamp(36px, 7vw, 44px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
  z-index: 10;
}
.login-card .login-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}
.login-card .login-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .login-modal,
  .login-modal::before,
  .login-modal::after,
  .login-floating-shape,
  .login-card,
  .login-card::before,
  .login-card::after,
  .login-logo,
  .login-logo::after,
  .login-card h2,
  .login-sub,
  .login-input-group,
  .login-support,
  .quiz-btn-block,
  .quiz-btn-block::before,
  .quiz-btn-block .btn-spinner,
  .login-close {
    animation: none !important;
    transition: none !important;
  }
  .login-input-group:focus-within .login-input-icon {
    transform: translateY(-50%);
  }
}

.siswa-badge {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: var(--brand-100);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}
.siswa-ganti {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
}
.siswa-ganti:hover {
  text-decoration: underline;
}

/* ===== ANIMASI KONTEN MODUL: isi tampil perlahan satu per satu ===== */

/* Saat halaman modul dibuka, tiap blok isi (judul, deskripsi, Capaian
   Pembelajaran, lalu setiap sub-bab/artikel) muncul pelan dan berurutan.
   Gunakan fill-mode "backwards" (bukan "both"/"forwards") supaya setelah
   animasi selesai transform-nya dilepas — elemen posisi fixed di dalamnya
   (mis. progress bar) tidak "terjebak" ikut bergeser. */
.module > * {
  animation: modUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.module > *:nth-child(1) { animation-delay: 0.05s; }
.module > *:nth-child(2) { animation-delay: 0.15s; }
.module > *:nth-child(3) { animation-delay: 0.25s; }
.module > *:nth-child(4) { animation-delay: 0.35s; }
.module > *:nth-child(5) { animation-delay: 0.45s; }
.module > *:nth-child(6) { animation-delay: 0.55s; }
.module > *:nth-child(7) { animation-delay: 0.65s; }
.module > *:nth-child(8) { animation-delay: 0.75s; }
.module > *:nth-child(n+9) { animation-delay: 0.85s; }

@keyframes modUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .module > * {
    animation: none !important;
  }
}

/* ===== Ukuran tombol profesional: target sentuh min. 44px (48px di layar sentuh) ===== */
@media (pointer: coarse) {
  .quiz-btn,
  .pager { min-height: 48px; }
}

/* Pengaman AOS (beranda): saat animasi dimatikan, elemen tidak boleh tersembunyi */
@media (prefers-reduced-motion: reduce) {
  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}

/* ===== Komponen bersama: button + input (gabungan css/components.css) =====
   Satu file global: style.css + komponen. responsive.css tetap terpisah
   karena mengatur sidebar/drawer yang berbeda di halaman admin. */

/* ----- Button teks admin (.btn + varian) ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: clamp(0.5rem, 1.5vw, 0.65rem) clamp(1rem, 2.5vw, 1.25rem); min-height: clamp(34px, 4.6vw, 40px); border-radius: var(--radius-pill); font-weight: 500; font-size: clamp(0.82rem, 1.7vw, 0.88rem);
  cursor: pointer; border: 1.5px solid transparent; text-decoration: none;
  transition: transform 0.15s, filter 0.2s, background 0.2s, box-shadow 0.2s;
}
.btn-primary { background: var(--gradient-soft); color: #fff; box-shadow: 0 8px 20px rgba(109,40,217,0.32); }
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.07); box-shadow: 0 12px 26px rgba(109,40,217,0.38); }
.btn-primary:active { transform: translateY(0); }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg-soft); border-color: var(--brand-300); }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.btn-block { width: 100%; margin-top: 0.6rem; }
.back-home { margin-top: 0.6rem; padding: 0.6rem 1rem; font-size: 0.85rem; min-height: 40px; }
.btn svg.lucide { width: clamp(16px, 3.5vw, 19px); height: clamp(16px, 3.5vw, 19px); flex-shrink: 0; }

/* ----- Icon button (aksi baris tabel) ----- */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-round); border: 1px solid var(--border);
  background: #fff; cursor: pointer; color: var(--primary-dark);
  transition: background 0.2s ease, transform 0.15s ease, color 0.2s ease;
}
.icon-btn:hover { background: var(--bg-soft); }
.icon-btn.icon-danger { color: var(--danger-600); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn svg.lucide { width: 17px; height: 17px; }

/* ----- Size button (pilihan jumlah baris) ----- */
.size-btn { padding: 0.45rem 0.85rem; min-height: 36px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: #fff; cursor: pointer; font-weight: 500; font-size: 0.8rem; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease; }
.size-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ----- Tab button ----- */
.tab-btn {
  flex: 0 1 auto; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.45rem 0.95rem; min-height: 36px; border: none; background: transparent; border-radius: var(--radius-pill);
  font-size: 0.85rem; font-weight: 500; color: var(--text-muted); cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.tab-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.tab-btn:hover { color: var(--primary-dark); }
.tab-btn.active { background: var(--gradient-soft); color: #fff; box-shadow: 0 4px 12px rgba(109,40,217,0.3); }
.tab-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(109,40,217,0.3); }

/* ----- File button (label upload CSV) ----- */
.file-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.95rem; min-height: 36px; border: 1.5px dashed var(--brand-300); border-radius: var(--radius-pill); cursor: pointer; font-weight: 500; font-size: 0.85rem; color: var(--primary-dark); transition: background 0.2s ease, border-color 0.2s ease; }
.file-btn svg { width: 17px; height: 17px; }
.file-name { font-size: 0.8rem; color: var(--text-muted); font-weight: 400; }

/* ----- Input & select admin ----- */
.form-grid input, .search-box input, .filter-select {
  padding: 0.65rem 0.85rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-pill); font-size: 0.9rem; outline: none; background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-grid input:focus, .search-box input:focus { border-color: var(--primary); }
.modal-form input { padding: 0.7rem 0.9rem; border: 1.5px solid var(--border); border-radius: var(--radius-pill); outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }

/* ----- Button halaman hasil ----- */
.hasil-btn {
  padding: 0.85rem 1.4rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--gradient-soft);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(109, 40, 217, 0.35);
}
.hasil-btn:disabled { opacity: 0.6; cursor: wait; }
.hasil-ghost {
  flex: 1;
  min-width: 150px;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.hasil-ghost:hover { background: var(--bg-soft); }
.hasil-btn, .hasil-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem; min-height: 48px; }
.hasil-btn svg.lucide, .hasil-ghost svg.lucide {
  width: clamp(16px, 4vw, 19px);
  height: clamp(16px, 4vw, 19px);
  flex-shrink: 0;
}