/* ============================================================
   TJKT Quest — Base: reset, tipografi, tata letak, utilitas
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--line-height);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

img, svg, video { display: block; max-width: 100%; }

h1, h2, h3, h4 { line-height: var(--line-height-heading); font-weight: 700; overflow-wrap: break-word; }
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }

p { overflow-wrap: break-word; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font: inherit; }

/* ---- Fokus selalu terlihat (WCAG 2.1 AA) ---- */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  z-index: 999;
  border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus { left: 0; }

.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;
}

/* ---- Ikon ---- */
.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  vertical-align: middle;
}
.icon-sm { width: 1rem; height: 1rem; }
.icon-lg { width: 1.75rem; height: 1.75rem; }

/* ---- Tata letak umum ---- */
.container {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.page-pad { padding-block: var(--space-5); }

.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--space-2); }
.row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }

.grid-cards {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.section { padding-block: var(--space-6); }

.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }

/* ---- Progress bar ---- */
.progress {
  height: 10px;
  background: var(--color-surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-full);
  transition: width var(--transition);
}

/* ---- Skeleton (loading) ---- */
.skeleton {
  background: linear-gradient(90deg, var(--color-surface-2) 25%, var(--color-border) 50%, var(--color-surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-md);
  min-height: 1rem;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Utilitas tampilan ---- */
.hidden { display: none !important; }

@media (max-width: 767.98px) {
  .hidden-sm { display: none !important; }
}
