/* ==========================================================================
   cvats - Netvora
   Token warna dan tipografi diambil dari situs perusahaan netvora.co.id,
   supaya produk ini satu keluarga dengan web perusahaan.
   ========================================================================== */

:root {
  --navy: #0d203c;
  --navy-2: #142b4b;
  --blue: #0969f7;
  --blue-2: #0155d8;
  --cyan: #25b7f5;
  --sky: #eaf5ff;
  --sky-2: #f5faff;
  --text: #17263d;
  --muted: #6c7c91;
  --line: #e1eaf4;
  --white: #ffffff;
  --danger: #c0392b;
  --ok: #1f8a4c;

  --shadow: 0 16px 42px rgba(25, 76, 140, 0.10);
  --shadow-kecil: 0 2px 8px rgba(25, 76, 140, 0.07);

  --radius: 22px;
  --radius-kecil: 11px;
  --radius-pil: 999px;

  --lebar-menu: 268px;
  --tinggi-atas: 64px;

  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.65;
  font-size: 16px;
}

h1, h2, h3 { line-height: 1.22; margin: 0 0 10px; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.6rem, 1.15rem + 2vw, 2.3rem); font-weight: 800; }
h2 { font-size: clamp(1.15rem, 1rem + 0.8vw, 1.45rem); font-weight: 750; }
h3 { font-size: 1.02rem; font-weight: 700; }

p { margin: 0 0 14px; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-2); }

/* Tautan yang berada DI DALAM paragraf: tinggi barisnya cuma ~22px, di
   bawah ambang sentuh. Tinggi sentuhnya dinaikkan tanpa menambah padding
   mendatar, supaya aliran teks tidak berubah. */
p a, li a, .bantuan a, .kecil a { display: inline-block; padding: 11px 0; }

/* Fokus harus selalu terlihat: pengguna papan ketik bergantung padanya. */
:focus-visible {
  outline: 3px solid rgba(9, 105, 247, 0.45);
  outline-offset: 2px;
  border-radius: 4px;
}

.muted { color: var(--muted); }
.kecil { font-size: 0.875rem; }
.rapat { margin-bottom: 6px; }

.sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   Tombol
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  font: inherit; font-weight: 700; font-size: 0.95rem;
  border: 1px solid transparent; border-radius: var(--radius-pil);
  cursor: pointer; text-align: center;
  transition: background-color .15s, border-color .15s, color .15s, transform .06s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.btn-utama { background: var(--blue); color: var(--white); }
.btn-utama:hover { background: var(--blue-2); color: var(--white); }

.btn-garis { background: var(--white); color: var(--navy); border-color: var(--line); }
.btn-garis:hover { border-color: var(--navy); color: var(--navy); }

.btn-penuh { width: 100%; }

/* --------------------------------------------------------------------------
   Formulir
   -------------------------------------------------------------------------- */

.medan { margin-bottom: 16px; }

.medan label {
  display: block; font-weight: 650; font-size: 0.9rem;
  margin-bottom: 6px; color: var(--navy);
}

.medan input,
.medan textarea,
.medan select {
  width: 100%; font: inherit; font-size: 0.97rem;
  padding: 12px 14px; min-height: 46px;
  color: var(--text); background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius-kecil);
}
.medan input:hover, .medan textarea:hover { border-color: #c9d8e8; }
.medan input:focus, .medan textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(9, 105, 247, 0.14);
  outline: none;
}
.medan textarea { min-height: 110px; resize: vertical; line-height: 1.6; }

.bantuan { display: block; margin-top: 5px; font-size: 0.82rem; color: var(--muted); }

.pesan {
  display: none; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-kecil);
  font-size: 0.9rem; margin-bottom: 16px; line-height: 1.5;
}
.pesan.tampil { display: flex; }
.pesan.salah { background: #fdf0ee; border: 1px solid #f3cdc6; color: #8c2b1e; }
.pesan.benar { background: #eef9f2; border: 1px solid #c7e8d5; color: #15603a; }
.pesan.info  { background: var(--sky); border: 1px solid #cfe4f8; color: var(--navy); }

.kode-angka {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.35rem; letter-spacing: 0.28em; text-align: center;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Halaman masuk / daftar
   Satu kolom terpusat. Di layar lebar, kolom kiri menjelaskan produk.
   -------------------------------------------------------------------------- */

.halaman-auth {
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--white);
}

.auth-sisi {
  background: var(--navy); color: var(--white);
  padding: 48px 52px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-sisi h2 { color: var(--white); font-size: 1.7rem; font-weight: 800; max-width: 22ch; }
.auth-sisi p { color: #b9c9de; max-width: 38ch; }
.auth-sisi .merek { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 1.06rem; }
.auth-sisi ul { list-style: none; padding: 0; margin: 26px 0 0; }
.auth-sisi li {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 11px 0; border-top: 1px solid rgba(255,255,255,.12);
  color: #d5e1f0; font-size: 0.93rem;
}
.auth-sisi li:last-child { border-bottom: 1px solid rgba(255,255,255,.12); }

.auth-sisi .penanda {
  flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px;
  border: 1.5px solid var(--cyan); border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.7rem; font-weight: 700; color: var(--cyan);
}

.auth-utama {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
}
.auth-kotak { width: 100%; max-width: 420px; }

.auth-kotak .kepala { margin-bottom: 26px; }
.auth-kotak .kepala h1 { font-size: 1.75rem; margin-bottom: 6px; }

.langkah { display: none; }
.langkah.aktif { display: block; }

/* --------------------------------------------------------------------------
   Kerangka aplikasi: sidebar + isi
   -------------------------------------------------------------------------- */

.aplikasi { min-height: 100vh; min-height: 100dvh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--lebar-menu);
  background: var(--navy); color: var(--white);
  display: flex; flex-direction: column; padding: 20px 16px;
  overflow-y: auto;
}

.sidebar .merek {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 8px 20px; font-weight: 800; font-size: 1.02rem; color: var(--white);
}
.sidebar .merek span.sub {
  display: block; font-size: 0.72rem; font-weight: 600;
  color: #8ba3c2; letter-spacing: 0.01em;
}

.lambang {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px;
  background: var(--blue); color: var(--white);
  display: grid; place-items: center; font-weight: 800; font-size: 0.86rem;
}

.sidebar nav { display: flex; flex-direction: column; gap: 3px; }

.sidebar .judul-grup {
  padding: 16px 10px 7px; font-size: 0.71rem;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: #7c93b0; font-weight: 700;
}

.pautan {
  display: flex; align-items: center; gap: 11px;
  min-height: 46px; padding: 9px 12px; border-radius: 10px;
  color: #cfdcec; font-weight: 600; font-size: 0.93rem;
  border: 1px solid transparent; background: none;
  font-family: inherit; cursor: pointer; text-align: left; width: 100%;
}
.pautan:hover { background: rgba(255,255,255,.07); color: var(--white); }
.pautan.aktif {
  background: rgba(9, 105, 247, .22);
  border-color: rgba(37, 183, 245, .45);
  color: var(--white);
}

/* Titik status menandai keadaan sungguhan alat: hijau hidup, merah mati,
   kuning sedang diperiksa. Bukan hiasan. */
.titik {
  flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); margin-left: auto;
}
.titik.hidup { background: #3ddc84; }
.titik.mati  { background: #ff6b5e; }
.titik.tunggu { background: #f5b942; }

.sidebar .kaki {
  margin-top: auto; padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.sidebar .siapa {
  padding: 2px 10px 10px; font-size: 0.82rem; color: #a8bcd5;
  overflow: hidden; text-overflow: ellipsis;
}
.sidebar .siapa strong { display: block; color: var(--white); font-size: 0.9rem; }

.isi {
  margin-left: var(--lebar-menu); min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; background: var(--sky-2);
}

.bilah-atas {
  min-height: var(--tinggi-atas); background: var(--white);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 11px 26px;
  position: sticky; top: 0; z-index: 20;
}
.bilah-atas h1 { font-size: 1.12rem; margin: 0; font-weight: 750; }
.bilah-atas .ket { display: block; font-size: 0.8rem; font-weight: 500; color: var(--muted); }
.bilah-atas .aksi { margin-left: auto; display: flex; gap: 9px; align-items: center; }

.isi-dalam { padding: 26px; flex: 1; }

.kartu {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-kecil);
}
.kartu + .kartu { margin-top: 18px; }

.panel-tool {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-kecil);
}
.panel-tool iframe { width: 100%; border: 0; display: block; height: 76vh; background: var(--white); }

.tombol-menu {
  display: none; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px; font: inherit; font-weight: 650;
  background: var(--white); color: var(--navy);
  border: 1px solid var(--line); border-radius: var(--radius-pil); cursor: pointer;
}

.tirai {
  display: none; position: fixed; inset: 0; z-index: 40;
  background: rgba(13, 32, 60, .5); border: 0;
}

/* --------------------------------------------------------------------------
   Baris ringkas (kartu kecil di kisi)
   -------------------------------------------------------------------------- */

.kisi { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.kisi-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }

/* --------------------------------------------------------------------------
   Navigasi bawah untuk layar sempit
   -------------------------------------------------------------------------- */

.bawah { display: none; }

@media (max-width: 980px) {
  .halaman-auth { grid-template-columns: 1fr; }
  .auth-sisi { padding: 32px 26px; }
  .auth-sisi h2 { font-size: 1.35rem; }
  .auth-sisi ul { display: none; }
}

@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 50; box-shadow: var(--shadow);
    width: min(84vw, 300px);
  }
  .sidebar.terbuka { transform: none; }
  .tirai.tampil { display: block; }
  .tombol-menu { display: inline-flex; }

  .isi { margin-left: 0; }

  /* Ruang untuk navigasi bawah, supaya tidak menutupi isi terakhir. */
  .isi-dalam { padding: 18px 16px; padding-bottom: 96px; }
  .bilah-atas { padding: 10px 16px; }
  .bilah-atas .aksi .sembunyi-hp { display: none; }
  .kartu { padding: 18px; border-radius: 16px; }
  .panel-tool iframe { height: 68vh; }
}

/* Di bawah ambang ini bilah samping diganti navigasi bawah. */
@media (max-width: 640px) {
  .bawah {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: var(--white); border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .bawah a {
    flex: 1; min-height: 52px; border-radius: 12px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; font-size: 0.7rem; font-weight: 650; color: var(--muted);
    padding: 6px 2px;
  }
  .bawah a.aktif { background: var(--sky); color: var(--blue); }
  .bawah .tanda {
    width: 8px; height: 8px; border-radius: 50%; background: currentColor;
    opacity: .45;
  }
  .bawah a.aktif .tanda { opacity: 1; background: var(--blue); }
}

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