/* ====== Reset ringkas & tokens ====== */
* {
  box-sizing: border-box;
}

:root {
  --bg: #0b1020;
  --bg-soft: #0f1530;
  --card: #121a39;
  --card-soft: #142044;
  --text: #e9ecf6;
  --muted: #9aa3bc;
  --primary: #4f7cff;
  --primary-2: #7ea2ff;
  --success: #3ecf8e;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  --radius: 16px;
  --radius-sm: 12px;
  --container: 1200px;

  /* Patch UI */
  --topbar-height: 64px;
  --card-height: 280px;
  --thumb-height: 160px;
}

html,
body {
  height: 100%;
}
body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.55;
}
a {
  color: inherit;
  text-decoration: none;
}
code {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 6px;
}

/* ====== Layout util ====== */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}
.row {
  display: flex;
  gap: 12px;
}
.row-center {
  align-items: center;
}
.between {
  justify-content: space-between;
}
.wrap {
  flex-wrap: wrap;
}
.block {
  display: block;
  width: 100%;
}
.muted {
  color: var(--muted);
}

/* ====== Surface ====== */
.bg-app {
  background: radial-gradient(
      1200px 600px at 80% -20%,
      rgba(79, 124, 255, 0.18),
      rgba(79, 124, 255, 0) 60%
    ),
    radial-gradient(
      900px 480px at -10% 10%,
      rgba(62, 207, 142, 0.15),
      rgba(62, 207, 142, 0) 60%
    ),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}

/* ====== Topbar (header seragam) ====== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(140%) blur(6px);
  background: rgba(11, 16, 32, 0.6);
  border-bottom: 1px solid var(--border);
}
.topbar .container {
  min-height: var(--topbar-height);
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
}
.logo {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--success) 100%);
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.top-actions {
  display: flex;
  gap: 8px;
}

/* ====== Buttons ====== */
.btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  transition: transform 0.06s ease, background 0.2s ease, border-color 0.2s ease;
  font-weight: 600;
  line-height: 1; /* konsisten dengan topbar */
}
.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.22);
}
.btn.primary {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  border: none;
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.06);
}
.btn.lg {
  padding: 12px 18px;
  border-radius: 12px;
}

/* ====== Hero ====== */
.hero {
  padding: 44px 0 24px;
}
.hero-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
}
.hero h1 {
  font-size: clamp(26px, 3.2vw, 40px);
  margin: 0 0 10px;
}
.lead {
  color: var(--muted);
  font-size: 15px;
}
.cta {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.note {
  color: var(--muted);
  font-size: 13px;
  margin-top: 10px;
}

/* ====== Grid file (kartu seragam) ====== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

/* ====== Cards ====== */
/* Penting: .card TIDAK punya height tetap agar tidak memotong isi (login). */
.card {
  display: flex;
  flex-direction: column;
  /* height: var(--card-height);  -- DIPINDAH KE .grid .card */
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
/* Tinggi tetap khusus kartu di grid listing file */
.grid .card {
  height: var(--card-height);
}

.card.shadow {
  box-shadow: var(--shadow);
}
.card-head,
.card-foot {
  padding: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.card-foot {
  border-top: 1px solid var(--border);
  border-bottom: 0;
  justify-content: flex-end;
}
.card-body {
  padding: 16px;
}
.hoverable {
  transition: transform 0.08s ease, box-shadow 0.2s ease, border-color 0.2s;
}
.hoverable:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.22);
}

/* Area thumbnail adaptif (contain: tanpa cropping, isi tinggi/lebarnya) */
.card .thumb {
  position: relative;
  height: var(--thumb-height);
  background: #0a0e1a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.card .thumb img,
.card .thumb video,
.card .thumb iframe {
  width: 100%;
  height: 100%;
  object-fit: contain; /* portrait: full tinggi; landscape: full lebar */
  display: block;
}
.card .body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 12px 14px;
  gap: 6px;
}
.card .name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.card .meta {
  color: var(--muted);
  font-size: 12px;
}

/* ====== Chips & checklist ====== */
.chip {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}
.chip.success {
  border-color: rgba(62, 207, 142, 0.45);
  color: #b7f0d6;
  background: rgba(62, 207, 142, 0.08);
}
.chip.neutral {
  color: #c9d1ff;
  background: rgba(79, 124, 255, 0.1);
  border-color: rgba(79, 124, 255, 0.4);
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.checklist li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
}
.checklist li::before {
  content: "✔";
  color: var(--success);
  margin-top: 1px;
}

/* ====== Feature cards ====== */
.section {
  padding: 26px 0 60px;
}
.section-title {
  margin: 0 0 14px;
  font-size: 18px;
  color: var(--muted);
}
.features {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature.card {
  padding: 16px;
  display: grid;
  gap: 8px;
}
.feature .icon-wrap {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(
    135deg,
    rgba(79, 124, 255, 0.25),
    rgba(62, 207, 142, 0.25)
  );
}
.icon {
  width: 22px;
  height: 22px;
  fill: #dfe6ff;
}
.feature h3 {
  margin: 6px 0 0;
  font-size: 16px;
}
.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.feature .link {
  margin-top: 6px;
  font-weight: 600;
  color: #dfe6ff;
}

/* ====== Footer ====== */
.footer {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  background: rgba(255, 255, 255, 0.03);
}

/* ====== Modal & viewer ====== */
/* Pindahkan kontrol (judul + kualitas + tutup) ke bawah saat mobile & video play */
@media (max-width: 640px) {
  .modal.show.playing .modal-head {
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    width: 100%;
    padding: 8px 12px;
    background: rgba(9, 12, 24, 0.9);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--border);
    border-bottom: 0;
    z-index: 10000;
  }
  .modal.show.playing .modal-body {
    padding-bottom: 64px;
  } /* ruang bar bawah */
}

/* Konten viewer responsif */
.viewer video.fit,
.viewer iframe.fit,
.viewer img.fit {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* ====== Responsive ====== */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .top-actions {
    display: none;
  } /* ringkas di mobile */
}

/* ====== Auth (Login) ====== */
.auth {
  min-height: 100svh;
  min-height: -webkit-fill-available; /* iOS Safari fallback */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: auto; /* jika konten tinggi -> scroll, tidak terpotong */
  background: radial-gradient(
      900px 480px at 80% -10%,
      rgba(79, 124, 255, 0.18),
      rgba(79, 124, 255, 0) 60%
    ),
    radial-gradient(
      700px 380px at -10% 20%,
      rgba(62, 207, 142, 0.18),
      rgba(62, 207, 142, 0) 60%
    ),
    linear-gradient(180deg, #0b1020, #0f1530);
}
@media (max-height: 560px) {
  .auth {
    align-items: flex-start;
  }
}
.auth .auth-card {
  width: min(420px, 92vw);
}
.auth .head {
  min-height: 64px;
}
.auth .body {
  display: grid;
  gap: 12px;
  padding: 16px;
}
.auth .field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}
.auth label {
  font-size: 13px;
  color: #d1dcff;
}
.auth input {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: #0f1633;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  outline: none;
}
.auth input:focus {
  box-shadow: 0 0 0 4px rgba(79, 124, 255, 0.18);
  border-color: #3b63d0;
}
.auth .btn {
  width: 100%;
  margin-top: 8px;
} /* tidak dempet */
.auth .links {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
