/* =====================================================
   Website Promosi Aplikasi — stylesheet utama
   ===================================================== */

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --accent: #06b6d4;
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-faint: #94a3b8;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --line: #e2e8f0;
  --ok: #16a34a;
  --radius: 14px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .08);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, .10);
  --shadow-lg: 0 20px 45px rgba(15, 23, 42, .16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(1.7rem, 4vw, 2.7rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); }
p { margin: 0 0 1em; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(1140px, 100% - 2.5rem); margin-inline: auto; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--primary); color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .72rem 1.35rem; border-radius: 999px; border: 2px solid transparent;
  font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 18px rgba(79, 70, 229, .35); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { border-color: var(--primary); color: var(--primary); background: #fff; }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .4); }
.btn-ghost:hover { background: rgba(255, 255, 255, .22); }
.btn-ghost-dark { color: var(--ink-soft); border-color: var(--line); background: #fff; }
.btn-light { background: #fff; color: var(--primary); font-weight: 700; }
.btn-sm { padding: .45rem 1rem; font-size: .87rem; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: .8rem 0; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.main-nav { display: flex; align-items: center; gap: 1.4rem; }
.main-nav a { color: var(--ink-soft); font-weight: 600; font-size: .95rem; }
.main-nav a:hover, .main-nav a.is-active { color: var(--primary); text-decoration: none; }
.main-nav .nav-cta { color: #fff; }

.nav-toggle { display: none; background: none; border: 0; padding: .4rem; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2.5px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: .2s; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(6, 182, 212, .35), transparent 60%),
    radial-gradient(700px 500px at 10% 110%, rgba(99, 102, 241, .55), transparent 60%),
    linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #4338ca 100%);
  color: #fff; overflow: hidden;
}
.hero-inner {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center;
  padding: 4.5rem 0 5rem;
}
.hero-text h1 { color: #fff; margin-bottom: .6rem; }
.hero-text p { color: #c7d2fe; font-size: 1.08rem; max-width: 34rem; }
.hero-badge {
  display: inline-block; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25);
  padding: .3rem .9rem; border-radius: 999px; font-size: .8rem; font-weight: 600; letter-spacing: .02em; margin-bottom: 1rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.4rem 0 2rem; }
.hero-stats { display: flex; gap: 2.4rem; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.5rem; }
.hero-stats span { color: #c7d2fe; font-size: .85rem; }

.hero-visual { position: relative; min-height: 340px; }
.hero-card {
  position: absolute; display: flex; align-items: center; gap: .8rem;
  background: rgba(255, 255, 255, .96); border-radius: var(--radius);
  padding: .8rem 1.1rem; box-shadow: var(--shadow-lg); color: var(--ink);
  width: 240px; transition: transform .25s ease;
}
.hero-card:hover { transform: translateY(-5px) !important; text-decoration: none; }
.hero-card img { width: 46px; height: 46px; border-radius: 12px; }
.hero-card strong { display: block; font-size: .95rem; }
.hero-card span { font-size: .78rem; color: var(--ink-faint); }
.hero-card-1 { top: 6%; right: 12%; transform: rotate(-3deg); }
.hero-card-2 { top: 40%; right: 32%; transform: rotate(2deg); }
.hero-card-3 { top: 72%; right: 6%; transform: rotate(-1.5deg); }

/* ---------- Section ---------- */
.section { padding: 4rem 0; }
.section-alt { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 40rem; margin: 0 auto 2.4rem; }
.section-head p { color: var(--ink-soft); }

/* ---------- Kartu aplikasi ---------- */
.app-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 1.4rem;
}
.app-grid-narrow { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.app-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease;
  height: 100%;
}
.app-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.app-card-link { display: flex; flex-direction: column; gap: .7rem; padding: 1.15rem; height: 100%; color: inherit; }
.app-card-link:hover { text-decoration: none; }
.app-card-top { display: flex; gap: .85rem; align-items: center; }
.app-icon { width: 54px; height: 54px; border-radius: 14px; flex: none; box-shadow: var(--shadow-sm); }
.app-card-title h3 { margin: 0; font-size: 1.02rem; }
.app-category { font-size: .78rem; color: var(--ink-faint); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.app-tagline { color: var(--ink-soft); font-size: .9rem; margin: 0; flex: 1; }
.app-card-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .3rem; }
.app-card-cta { font-size: .83rem; font-weight: 700; color: var(--primary); }
.badge-row { display: flex; flex-wrap: wrap; gap: .35rem; }
.badge {
  font-size: .7rem; font-weight: 700; padding: .18rem .55rem; border-radius: 999px; letter-spacing: .02em;
}
.badge-android { background: #dcfce7; color: #15803d; }
.badge-web { background: #cffafe; color: #0e7490; }
.badge-rating { background: #fef3c7; color: #b45309; }
.badge-category { background: var(--primary-light); color: var(--primary-dark); }

/* ---------- Toolbar / filter ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between;
  margin-bottom: 2rem;
}
.toolbar-form { justify-content: flex-start; }
.filter-chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink-soft);
  padding: .45rem 1.1rem; border-radius: 999px; font-weight: 600; font-size: .88rem; cursor: pointer;
  transition: .15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.search-input, .select-input {
  border: 1.5px solid var(--line); border-radius: 999px; padding: .55rem 1.1rem;
  font-size: .92rem; font-family: inherit; background: #fff; min-width: 200px; color: var(--ink);
}
.search-input:focus, .select-input:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.empty-state { text-align: center; color: var(--ink-soft); padding: 2.5rem 0; }
.empty-state h1 { margin-bottom: .4rem; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.4rem; }
.step {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem 1.4rem; box-shadow: var(--shadow-sm);
}
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; background: var(--primary-light);
  color: var(--primary-dark); font-weight: 800; margin-bottom: .8rem;
}
.step h3 { font-size: 1.05rem; }
.step p { color: var(--ink-soft); font-size: .92rem; margin: 0; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--primary) 0%, #7c3aed 60%, var(--accent) 100%);
  color: #fff;
}
.cta-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.cta-inner h2 { color: #fff; margin: 0 0 .3rem; }
.cta-inner p { margin: 0; color: #e0e7ff; }

/* ---------- Page hero ---------- */
.page-hero {
  background: linear-gradient(120deg, #1e1b4b, #4338ca); color: #fff; padding: 3rem 0;
}
.page-hero h1 { color: #fff; margin: 0 0 .3rem; }
.page-hero p { margin: 0; color: #c7d2fe; }

/* ---------- Detail aplikasi ---------- */
.detail-hero {
  background: linear-gradient(160deg, #f5f3ff 0%, #eef2ff 60%, #ffffff 100%);
  padding: 2rem 0 2.6rem; border-bottom: 1px solid var(--line);
}
.breadcrumb { font-size: .85rem; color: var(--ink-faint); margin-bottom: 1.4rem; }
.breadcrumb span { margin: 0 .35rem; }
.breadcrumb a { color: var(--ink-soft); }
.detail-head { display: flex; gap: 1.8rem; align-items: flex-start; }
.detail-icon { width: 108px; height: 108px; border-radius: 26px; box-shadow: var(--shadow-md); flex: none; background: #fff; }
.detail-title h1 { margin: .5rem 0 .2rem; }
.detail-tagline { color: var(--ink-soft); margin-bottom: .6rem; }
.detail-meta-row { display: flex; flex-wrap: wrap; gap: 1.2rem; color: var(--ink-soft); font-size: .9rem; font-weight: 600; margin-bottom: 1.1rem; }
.detail-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.external-note { font-size: .8rem; color: var(--ink-faint); margin: .7rem 0 0; }
.no-link-note { color: var(--ink-faint); font-style: italic; }

.detail-layout { display: grid; grid-template-columns: 1fr 300px; gap: 2.6rem; align-items: start; }
.detail-main h2 { margin-top: 2rem; }
.detail-main h2:first-child { margin-top: 0; }
.detail-main p { color: var(--ink-soft); }

.screenshot-strip { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: .6rem; }
.shot {
  border: 0; padding: 0; background: none; cursor: zoom-in; flex: none;
  border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-md); transition: transform .18s ease;
}
.shot:hover { transform: scale(1.03); }
.shot img { width: 172px; height: auto; }

.info-box {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; box-shadow: var(--shadow-sm); margin-bottom: 1.2rem;
}
.info-box h3 { font-size: 1rem; margin-bottom: .8rem; }
.info-box dl { margin: 0; }
.info-box dl div { display: flex; justify-content: space-between; gap: 1rem; padding: .42rem 0; border-bottom: 1px dashed var(--line); font-size: .89rem; }
.info-box dl div:last-child { border-bottom: 0; }
.info-box dt { color: var(--ink-faint); }
.info-box dd { margin: 0; font-weight: 600; text-align: right; }
.info-box-note { background: #f0fdf4; border-color: #bbf7d0; }
.info-box-note p { margin: 0; font-size: .87rem; color: #166534; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .88); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 88vh; max-width: 100%; border-radius: 12px; box-shadow: var(--shadow-lg); }
.lightbox-close {
  position: absolute; top: 1rem; right: 1.4rem; background: none; border: 0;
  color: #fff; font-size: 2.6rem; line-height: 1; cursor: pointer;
}

/* ---------- Tentang ---------- */
.prose { max-width: 46rem; }
.prose p { color: var(--ink-soft); }
.prose li { color: var(--ink-soft); margin-bottom: .4rem; }

/* ---------- Footer ---------- */
.site-footer { background: #0f172a; color: #cbd5e1; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.4rem; padding: 3rem 0 2rem; }
.brand-footer { color: #fff; margin-bottom: .7rem; }
.footer-desc { font-size: .9rem; color: #94a3b8; max-width: 22rem; }
.footer-col h4 { color: #fff; font-size: .95rem; margin-bottom: .9rem; }
.footer-col a { display: block; color: #cbd5e1; font-size: .9rem; padding: .18rem 0; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 1.1rem 0; font-size: .82rem; color: #94a3b8; }
.footer-bottom p { margin: 0; }
.footer-note { color: #64748b; }

/* =====================================================
   Admin
   ===================================================== */
.admin-body { background: var(--bg-soft); }
.admin-topbar {
  background: #0f172a; color: #fff; position: sticky; top: 0; z-index: 50;
}
.admin-topbar .header-inner { padding: .7rem 0; }
.admin-topbar .brand { color: #fff; }
.admin-nav { display: flex; align-items: center; gap: 1.3rem; flex-wrap: wrap; }
.admin-nav a { color: #cbd5e1; font-weight: 600; font-size: .92rem; }
.admin-nav a:hover, .admin-nav a.is-active { color: #fff; text-decoration: none; }
.admin-main { padding: 2.2rem 0 3.5rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1.1rem; margin-bottom: 2rem; }
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.3rem; box-shadow: var(--shadow-sm);
}
.stat-card strong { display: block; font-size: 1.7rem; color: var(--primary-dark); }
.stat-card span { color: var(--ink-soft); font-size: .88rem; }

.panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 1.5rem; margin-bottom: 1.6rem;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 1.2rem; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: .7rem .8rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { background: var(--bg-soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
table.data tr:hover td { background: #fafaff; }
.table-app { display: flex; align-items: center; gap: .7rem; }
.table-app img { width: 38px; height: 38px; border-radius: 10px; }
.actions { display: flex; gap: .45rem; flex-wrap: wrap; }

/* ---------- Form ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.4rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .3rem; }
.field .hint { display: block; color: var(--ink-faint); font-size: .78rem; margin-top: .25rem; }
.field input[type="text"], .field input[type="url"], .field input[type="number"],
.field input[type="password"], .field input[type="email"], .field select, .field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px;
  padding: .6rem .8rem; font-size: .93rem; font-family: inherit; background: #fff; color: var(--ink);
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.checkbox { display: flex; align-items: center; gap: .5rem; font-size: .92rem; }
.checkbox input { width: 18px; height: 18px; }
.form-actions { display: flex; gap: .7rem; margin-top: 1.4rem; flex-wrap: wrap; }
.current-thumb { width: 64px; height: 64px; border-radius: 14px; border: 1px solid var(--line); margin-top: .5rem; }
.shot-list { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: .7rem; }
.shot-item { position: relative; }
.shot-item img { width: 84px; border-radius: 10px; border: 1px solid var(--line); }
.shot-item button {
  position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: #dc2626; color: #fff; cursor: pointer; font-size: .8rem; line-height: 1;
}

/* ---------- Grafik batang statistik ---------- */
.bar-chart {
  display: flex; align-items: flex-end; gap: 4px;
  height: 200px; padding-top: 1.4rem; overflow-x: auto;
}
.bar-col {
  flex: 1; min-width: 18px; display: flex; flex-direction: column;
  align-items: center; height: 100%; gap: .25rem;
}
.bar-track {
  flex: 1; width: 100%; display: flex; align-items: flex-end;
  background: var(--bg-soft); border-radius: 6px 6px 0 0; overflow: hidden; min-height: 4px;
}
.bar-fill {
  width: 100%; min-height: 3px; border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  transition: height .3s ease;
}
.bar-label { font-size: .58rem; color: var(--ink-faint); white-space: nowrap; transform: rotate(-45deg); margin-top: .4rem; }
.bar-value { font-size: .66rem; font-weight: 700; color: var(--primary-dark); }

/* ---------- Alert ---------- */
.alert { padding: .85rem 1.1rem; border-radius: 10px; margin-bottom: 1.3rem; font-size: .92rem; }
.alert-ok { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-err { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background: linear-gradient(135deg, #1e1b4b, #4338ca); }
.login-card { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); padding: 2.2rem; width: min(400px, 100%); }
.login-card h1 { font-size: 1.4rem; text-align: center; }
.login-card .login-sub { text-align: center; color: var(--ink-soft); font-size: .9rem; margin-bottom: 1.5rem; }
.login-card .field { margin-bottom: 1rem; }
.login-back { display: block; text-align: center; margin-top: 1.2rem; font-size: .86rem; }

/* =====================================================
   Responsif
   ===================================================== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; padding: 3rem 0 3.5rem; gap: 2rem; }
  .hero-visual { display: none; }
  .detail-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md);
    flex-direction: column; align-items: flex-start; padding: 1rem 1.25rem; gap: .9rem;
  }
  .main-nav.is-open { display: flex; }
  .detail-head { flex-direction: column; gap: 1.1rem; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-input, .select-input { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .section { padding: 2.8rem 0; }
  .hero-stats { gap: 1.6rem; }
}
