/* img-host - UI internal. Utilitas dulu, hiasan belakangan. */

:root {
  --bg:      #101418;
  --panel:   #171C22;
  --panel-2: #1E252D;
  --garis:   #2A323C;
  --teks:    #E6EAEF;
  --redup:   #93A0AE;
  --aksen:   #4FA3FF;
  --oke:     #3DD68C;
  --salah:   #FF6B6B;
  --radius:  10px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

/* atribut hidden harus menang atas display eksplisit (mis. .login{display:flex}) */
[hidden] { display: none !important; }

body {
  margin: 0;
  padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2rem) 5rem;
  background: var(--bg);
  color: var(--teks);
  font: 400 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.dash, .login, .status { max-width: 44rem; margin-inline: auto; }

/* ------------------------------------------------------------- login view */

.login {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-kartu {
  width: 100%;
  max-width: 24rem;
  padding: 1.75rem 1.75rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--garis);
  border-radius: 14px;
}

.login-kartu h1 { margin: 0; font-size: 1.375rem; font-weight: 650; letter-spacing: -.02em; }
.login-kartu > p { margin: .25rem 0 1.5rem; color: var(--redup); font-size: .875rem; }
.login-kartu label { display: block; margin-bottom: .5rem; font-size: .8125rem; font-weight: 600; color: var(--redup); }

.login-baris { display: flex; gap: .5rem; margin-bottom: 1rem; }

#sandi {
  flex: 1 1 auto; min-width: 0;
  padding: .625rem .75rem;
  background: var(--bg); color: var(--teks);
  border: 1px solid var(--garis); border-radius: 8px;
  font: 400 .9375rem/1.4 var(--mono);
}
#sandi:focus { border-color: var(--aksen); outline: none; }

.tombol-utama {
  width: 100%;
  padding: .6875rem 1rem;
  background: var(--aksen); color: #06111F;
  border: none; border-radius: 8px;
  font: 600 .9375rem/1.2 inherit; cursor: pointer;
  transition: filter .14s ease;
}
.tombol-utama:hover { filter: brightness(1.07); }
.tombol-utama:disabled { opacity: .6; cursor: default; }

.login-galat { margin: 1rem 0 0; color: var(--salah); font-size: .8125rem; }

/* ------------------------------------------------------- dashboard header */

.dash-atas {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.dash-atas h1 { margin: 0; font-size: 1.375rem; font-weight: 650; letter-spacing: -.02em; }
.dash-atas p { margin: .25rem 0 0; color: var(--redup); font-size: .875rem; }

/* ------------------------------------------------------------- pustaka */

.pustaka { margin-top: 2rem; }
.pustaka-atas {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem;
}
.pustaka-atas h2 { margin: 0; font-size: 1rem; font-weight: 600; }
.pustaka-kosong { color: var(--redup); font-size: .875rem; }

.salin-hapus { color: var(--salah); }
.salin-hapus:hover { color: #fff; background: var(--salah); border-color: var(--salah); }
.salin-hapus:disabled { opacity: .5; cursor: default; }

:where(button, input, a, label.jatuh):focus-visible {
  outline: 2px solid var(--aksen);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ header */

.atas { margin-bottom: 1.75rem; }

.atas h1 {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 650;
  letter-spacing: -.02em;
}

.atas p {
  margin: .25rem 0 0;
  color: var(--redup);
  font-size: .875rem;
}

/* -------------------------------------------------------------------- token */

.kunci {
  margin-bottom: 1.25rem;
  padding: 1rem 1.125rem;
  background: var(--panel);
  border: 1px solid var(--garis);
  border-radius: var(--radius);
}

.kunci label {
  display: block;
  margin-bottom: .5rem;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--redup);
}

.kunci-baris { display: flex; gap: .5rem; }

#token {
  flex: 1 1 auto;
  min-width: 0;
  padding: .5625rem .75rem;
  background: var(--bg);
  color: var(--teks);
  border: 1px solid var(--garis);
  border-radius: 8px;
  font: 400 .875rem/1.4 var(--mono);
}

#token::placeholder { color: #5C6875; }
#token:focus { border-color: var(--aksen); outline: none; }

.petunjuk {
  margin: .625rem 0 0;
  color: var(--redup);
  font-size: .75rem;
  line-height: 1.45;
}

/* ------------------------------------------------------------------ tombol */

.tombol-kecil {
  flex: none;
  padding: .5625rem .875rem;
  background: var(--panel-2);
  color: var(--teks);
  border: 1px solid var(--garis);
  border-radius: 8px;
  font: 500 .8125rem/1.2 inherit;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease;
}

.tombol-kecil:hover { background: #262F39; border-color: #384250; }
.tombol-kecil:active { transform: translateY(1px); }
.tombol-kecil[data-sukses] { color: var(--oke); border-color: var(--oke); }

/* ------------------------------------------------------------- area jatuh */

.jatuh {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 2.75rem 1.5rem;
  background: var(--panel);
  border: 1.5px dashed var(--garis);
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}

.jatuh:hover { border-color: #3C4653; }

.jatuh[data-aktif] {
  border-color: var(--aksen);
  background: #14202D;
}

.jatuh svg {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--redup);
}

.jatuh-utama { font-weight: 550; }

.jatuh-kecil {
  color: var(--redup);
  font-size: .8125rem;
}

/* -------------------------------------------------------------------- alat */

.alat {
  display: flex;
  gap: .5rem;
  margin-top: 1.25rem;
}

/* ------------------------------------------------------------------ daftar */

.daftar {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .625rem;
}

.baris {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: .875rem;
  padding: .75rem;
  background: var(--panel);
  border: 1px solid var(--garis);
  border-radius: var(--radius);
}

.baris-gambar {
  width: 3rem;
  height: 3rem;
  flex: none;
  border-radius: 6px;
  background: var(--panel-2);
  overflow: hidden;
}

.baris-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.baris-ext {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--redup);
  font: 600 .6875rem/1 var(--mono);
  letter-spacing: .02em;
}

.baris-isi { min-width: 0; }

.baris-nama {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .75rem;
  font-size: .8125rem;
}

.baris-nama b {
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.baris-ukuran { flex: none; color: var(--redup); font-size: .75rem; }

/* progres */

.progres {
  margin-top: .5rem;
  height: 4px;
  background: var(--panel-2);
  border-radius: 2px;
  overflow: hidden;
}

.progres i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--aksen);
  transition: width .18s ease;
}

/* hasil */

.hasil {
  display: flex;
  gap: .375rem;
  margin-top: .5rem;
  align-items: center;
}

.tautan {
  flex: 1 1 auto;
  min-width: 0;
  padding: .375rem .5rem;
  background: var(--bg);
  border: 1px solid var(--garis);
  border-radius: 6px;
  color: var(--aksen);
  font: 400 .75rem/1.4 var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.tautan:hover { text-decoration: underline; }

.salin {
  flex: none;
  padding: .375rem .5rem;
  background: var(--panel-2);
  color: var(--redup);
  border: 1px solid var(--garis);
  border-radius: 6px;
  font: 500 .6875rem/1.3 inherit;
  cursor: pointer;
}

.salin:hover { color: var(--teks); }
.salin[data-sukses] { color: var(--oke); border-color: var(--oke); }

.galat {
  margin-top: .5rem;
  color: var(--salah);
  font-size: .8125rem;
}

.lencana {
  margin-top: .5rem;
  color: var(--redup);
  font-size: .75rem;
}

/* ------------------------------------------------------------------ status */

.status {
  margin-top: 1.25rem;
  color: var(--redup);
  font-size: .8125rem;
  min-height: 1.2em;
}

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