/* ============================================================
   LMS PT Brand CSS — v2.0 (Dark Edition)
   ============================================================ */

/* Alpine.js: sembunyikan elemen x-show sebelum init */
[x-cloak] { display: none !important; }
.hidden { display: none !important; }

:root {
  /* ── Core palette (dark) ── */
  --paper:      #0a0a0a;   /* Body background */
  --card:       #121212;   /* Card / surface */
  --surface2:   #1a1a1a;   /* Input, hover, subtle surface */
  --ink:        #e8e8e8;   /* Primary text */
  --line:       #222222;   /* Border / divider */
  --muted:      #888888;   /* Secondary text */
  --muted2:     #555555;   /* Placeholder, disabled */

  /* ── Level accent colors (unchanged — canonical) ── */
  --accent-l1:  #e84b2b;
  --accent-l2:  #1a6ee8;
  --accent-l3:  #1a9e6f;

  /* ── Semantic ── */
  --success:    #1a9e6f;
  --warning:    #f5a623;
  --danger:     #e84b2b;
  --info:       #60a5fa;

  /* ── Hero backgrounds (per level, dark) ── */
  --dark-l1:    #1a0a06;
  --dark-l2:    #0a1628;
  --dark-l3:    #061a12;

  /* ── Hero text — override di light theme ── */
  --hero-text:       #ffffff;
  --hero-text-muted: rgba(255,255,255,0.65);
  --hero-text-faint: rgba(255,255,255,0.55);
  --hero-bar-bg:     rgba(255,255,255,0.15);

  /* ── Reference standard colors (canonical — jangan ubah) ── */
  --nasm:   #a78bfa;
  --nsca:   #60a5fa;
  --issa:   #4ade80;
  --ace:    #fbbf24;
  --acsm:   #f87171;

  /* ── Spacing ── */
  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:   16px;
  --space-lg:   24px;
  --space-xl:   32px;
  --space-2xl:  48px;
  --space-3xl:  64px;

  /* ── Radius ── */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  margin: 0;
  overflow-wrap: break-word;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; overflow-wrap: break-word; }
h1 { font-size: clamp(22px, 6vw, 52px); font-weight: 800; line-height: 1.1; }
h2 { font-size: clamp(20px, 5vw, 26px); font-weight: 800; }
h3 { font-size: 17px; font-weight: 700; }
h4 { font-size: 14px; font-weight: 800; }

.content-area { max-width: 860px; margin: 0 auto; padding: 40px 24px 80px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

/* ── Navbar ── */
.navbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  display: flex; align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky; top: 0; z-index: 200;
}
.navbar-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}

.navbar-logo-box {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--accent-l1);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 9px; font-weight: 900;
  color: #fff;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.navbar-links {
  display: flex; align-items: center;
  gap: 24px; font-size: 14px; font-weight: 500;
}
.navbar-links a { color: var(--muted); transition: color 0.15s; }
.navbar-links a:hover { color: var(--ink); }

/* ── Card ── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}
.card-accent-l1 { border-left: 4px solid var(--accent-l1); }
.card-accent-l2 { border-left: 4px solid var(--accent-l2); }
.card-accent-l3 { border-left: 4px solid var(--accent-l3); }

/* ── Badge ── */
.badge {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--line);
}
.badge-l1 { background: var(--accent-l1); color: white; border-color: transparent; }
.badge-l2 { background: var(--accent-l2); color: white; border-color: transparent; }
.badge-l3 { background: var(--accent-l3); color: white; border-color: transparent; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Ref Badges (canonical colors — dark-optimized) ── */
.ref-badge {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px;
  display: inline-block;
}
.ref-nasm  { background: rgba(167,139,250,0.18); color: var(--nasm);  border: 1px solid rgba(167,139,250,0.3); }
.ref-nsca  { background: rgba(96,165,250,0.18);  color: var(--nsca);  border: 1px solid rgba(96,165,250,0.3); }
.ref-issa  { background: rgba(74,222,128,0.18);  color: var(--issa);  border: 1px solid rgba(74,222,128,0.3); }
.ref-ace   { background: rgba(251,191,36,0.15);  color: var(--ace);   border: 1px solid rgba(251,191,36,0.3); }
.ref-acsm  { background: rgba(248,113,113,0.18); color: var(--acsm);  border: 1px solid rgba(248,113,113,0.3); }

/* ── Button ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.04em;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none; cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { opacity: 0.85; }
.btn-l1 { background: var(--accent-l1); color: white; }
.btn-l1:hover { filter: brightness(0.9); }
.btn-l2 { background: var(--accent-l2); color: white; }
.btn-l2:hover { filter: brightness(0.9); }
.btn-l3 { background: var(--accent-l3); color: white; }
.btn-l3:hover { filter: brightness(0.9); }
.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--line);
}
.btn-outline:hover { border-color: var(--muted); }

/* ── Hero ── */
.hero { padding: 80px 24px; position: relative; overflow: hidden; }
.hero-l1 { background: linear-gradient(135deg, var(--dark-l1) 0%, #160804 100%); color: white; }
.hero-l2 { background: linear-gradient(135deg, var(--dark-l2) 0%, #0a1220 100%); color: white; }
.hero-l3 { background: linear-gradient(135deg, var(--dark-l3) 0%, #061410 100%); color: white; }
.hero-content { max-width: 640px; margin: 0 auto; position: relative; z-index: 2; }

/* ── Progress ── */
.progress-wrap {
  background: var(--line);
  border-radius: 99px; height: 6px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 99px;
  transition: width 0.5s ease;
  background: var(--accent-l1);
}

/* ── Table ── */
.table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
}
/* Tambahkan ke .table-wrap untuk buat tabel bisa di-scroll vertikal */
.table-scroll {
  overflow-y: auto;
  overflow-x: auto;
}
.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  background: var(--surface2);
  color: var(--ink);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--line);
}
td { padding: 11px 16px; border-bottom: 1px solid var(--line); color: var(--ink); }
tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.03); }

/* ── Callout ── */
.callout {
  display: flex; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid;
  font-size: 14px;
}
.callout-info    { background: rgba(96,165,250,0.08);  border-color: rgba(96,165,250,0.25);  color: var(--ink); }
.callout-success { background: rgba(26,158,111,0.08); border-color: rgba(26,158,111,0.25); color: var(--ink); }
.callout-danger  { background: rgba(232,75,43,0.08);  border-color: rgba(232,75,43,0.25);  color: var(--danger); }
.callout-warn    { background: rgba(245,166,35,0.08); border-color: rgba(245,166,35,0.25); color: var(--warning); }
.callout-purple  { background: rgba(167,139,250,0.08); border-color: rgba(167,139,250,0.25); color: var(--nasm); }

/* ── Form ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface2);
  color: var(--ink);
  transition: border-color 0.2s ease;
}
.form-control:focus {
  outline: none;
  border-color: var(--muted);
}
.form-control::placeholder { color: var(--muted2); }

select.form-control { cursor: pointer; }
select.form-control option { background: var(--surface2); color: var(--ink); }

/* Paksa background dark saat browser autofill (Chrome/Edge/Safari) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px var(--surface2) inset !important;
  -webkit-text-fill-color: var(--ink) !important;
  transition: background-color 5000s ease-in-out 0s;
  caret-color: var(--ink);
}

/* ── Messages ── */
.messages { padding: 0 24px; margin-top: 12px; }
.message {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 8px; font-size: 14px;
}
.message-error   { background: rgba(232,75,43,0.1);  color: var(--danger);  border: 1px solid rgba(232,75,43,0.25); }
.message-success { background: rgba(26,158,111,0.1); color: var(--success); border: 1px solid rgba(26,158,111,0.25); }
.message-info    { background: rgba(96,165,250,0.1); color: var(--info);    border: 1px solid rgba(96,165,250,0.25); }

/* ── Site Footer ── */
.site-footer {
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.3s ease forwards; }
.fade-up:nth-child(2) { animation-delay: 0.05s; }
.fade-up:nth-child(3) { animation-delay: 0.10s; }
.fade-up:nth-child(4) { animation-delay: 0.15s; }

@media (prefers-reduced-motion: reduce) {
  /* Universal: hormati preferensi user yang sensitif terhadap motion */
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Skip-to-content link untuk screen reader / keyboard users ── */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 8px;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  text-decoration: none;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
  border-radius: 4px;
  z-index: 10000;
  transition: top 0.2s ease;
}
.skip-to-content:focus {
  top: 8px;
}

/* ── Focus ring untuk keyboard nav ── */
/* :focus-visible hanya muncul untuk keyboard focus, bukan mouse click */
*:focus-visible {
  outline: 2px solid var(--accent-l1);
  outline-offset: 2px;
  border-radius: 2px;
}
/* Hapus outline default mouse-click yang flicker */
*:focus:not(:focus-visible) {
  outline: none;
}

/* ── Hamburger button ── */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 4px;
  line-height: 0;
  flex-shrink: 0;
}

/* ── Mobile / Tablet (≤ 768px) ── */
@media (max-width: 768px) {
  .nav-hamburger { display: flex; align-items: center; }

  .navbar-links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    position: fixed;
    top: 56px;
    left: 0; right: 0;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 8px 0 16px;
    z-index: 9999;
  }
  .navbar-links--open { display: flex; }

  .navbar-links a,
  .navbar-links form {
    width: 100%;
    padding: 12px 24px;
    border-bottom: 1px solid var(--line);
    display: block;
    box-sizing: border-box;
  }
  .navbar-links form button {
    width: 100%;
    text-align: left;
    padding: 0;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
  }

  /* Halaman publik umum */
  .content-area { padding: 24px 16px 64px; }

  /* Card stack pada mobile */
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  /* Tabel scroll horizontal */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Form */
  .form-control { font-size: 16px; } /* cegah iOS zoom saat focus */

  /* Profile page */
  .ld-content { padding: 24px 16px 64px; }
}

/* ── Extra small (≤ 480px) ── */
@media (max-width: 480px) {
  .lp-hero-h1 { font-size: 26px; }
  .card { padding: 16px; }
  .btn { padding: 10px 16px; font-size: 13px; }
}

/* ── Light theme overrides ── */
html[data-theme="light"] {
  --paper:    #f5f0e8;
  --card:     #ffffff;
  --surface2: #f0ece4;
  --ink:      #0f0e0c;
  --line:     #ddd8ce;
  --muted:    #7a7570;
  --muted2:   #b8b0a8;
  color-scheme: light;

  /* ── Hero teks & background di light mode ── */
  --hero-text:       var(--ink);
  --hero-text-muted: var(--muted);
  --hero-text-faint: var(--muted2);
  --hero-bar-bg:     var(--line);
}

html[data-theme="light"] .hero-l1 { background: linear-gradient(135deg, rgba(232,75,43,0.08) 0%, rgba(232,75,43,0.03) 100%); }
html[data-theme="light"] .hero-l2 { background: linear-gradient(135deg, rgba(26,110,232,0.08) 0%, rgba(26,110,232,0.03) 100%); }
html[data-theme="light"] .hero-l3 { background: linear-gradient(135deg, rgba(26,158,111,0.08) 0%, rgba(26,158,111,0.03) 100%); }

/* ── Theme toggle button (digunakan di navbar publik & admin) ── */
.theme-toggle-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  line-height: 0;
  flex-shrink: 0;
  transition: color 0.2s, background 0.2s;
}
.theme-toggle-btn:hover {
  color: var(--ink);
  background: var(--surface2);
}
/* Label hanya muncul di mobile (dalam dropdown) */
.theme-toggle-label { display: none; }

@media (max-width: 768px) {
  .navbar-links .theme-toggle-btn {
    width: 100%;
    padding: 12px 24px;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    box-sizing: border-box;
    justify-content: flex-start;
  }
  .navbar-links .theme-toggle-btn:hover { background: none; }
  .theme-toggle-label { display: inline; }
}
