:root{
  /* ===== Tema baru (sesuai permintaan) ===== */
  --bg-1:#0b1020;      /* gradasi atas */
  --bg-2:#0e1530;      /* gradasi bawah */
  --bg-3:#0a0f24;      /* latar elemen (card/input) */
  --text:#e8ecf4;      /* teks utama */
  --muted:#a9b6c9;     /* teks sekunder */
  --border:rgba(255,255,255,.08);
  --accent:#0E4D92;    /* biru utama */
  --accent-2:#0A3A6D;  /* biru gelap (hover/active) */

  --radius:20px;
  --shadow:0 10px 30px rgba(0,0,0,.35);
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* noise halus (opsional) */
  --noise: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 128 128"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="2"/></filter><rect width="128" height="128" filter="url(%23n)" opacity=".035"/></svg>');

  /* status */
  --danger:#ef4444;
  --ok:#22c55e;
}

/* ===== Reset ringan ===== */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; color:var(--text);
  background:
    linear-gradient(180deg,var(--bg-1),var(--bg-2)),
    var(--bg-1);
  min-height:100dvh; display:grid; place-items:center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial;
  -webkit-tap-highlight-color: transparent;
}

/* ===== Kontainer ===== */
.wrap{ width:min(92vw, 540px); padding:clamp(12px,2.5vmin,24px) }
.card{
  background: color-mix(in lab, var(--bg-3) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.card::before{
  /* noise lembut */
  content:""; position:absolute; inset:0; pointer-events:none;
  background: var(--noise);
  opacity:.7;
}

/* ===== Section ===== */
.section{ padding:clamp(18px,4.5vmin,28px); display:none }
.section.active{ display:block }

.title{ margin:0 0 .3rem; font-size:clamp(20px,3.8vw,28px); line-height:1.2 }
.subtitle{ margin:0 0 .6rem; color:var(--muted); font-size:clamp(13px,3.4vw,15px) }

/* ===== CTA ===== */
.cta{ margin-top:12px; display:flex; gap:10px }

/* ===== Tombol ===== */
.btn{
  width:100%; padding:14px 16px; border-radius:14px; border:1px solid var(--border);
  background: linear-gradient(135deg,var(--accent),var(--accent-2));
  color:#fff; font-weight:700; cursor:pointer;
  font-size:clamp(14px,3.6vw,16px);
  transition: transform .12s ease, filter .15s ease, box-shadow .15s ease;
  position:relative; overflow:hidden;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent), transparent 65%);
}
.btn:hover{ filter:brightness(1.05) }
.btn:active{ transform:scale(.98) }
.btn:disabled{ opacity:.6; cursor:not-allowed }

/* Ripple */
.btn::after{
  content:""; position:absolute; inset:auto; width:0; height:0; border-radius:50%;
  background:#ffffff40; opacity:0; transform:translate(-50%,-50%);
  pointer-events:none;
}
.btn:active::after{
  left:var(--x,50%); top:var(--y,50%); width:160px; height:160px;
  opacity:.28; transition:width .35s ease, height .35s ease, opacity .5s ease;
}

/* ===== Form ===== */
form{ display:grid; gap:12px; margin-top:8px }
label{ font-size:clamp(12px,3.2vw,14px); color:var(--muted) }
input{
  width:100%; padding:14px 14px; border-radius:12px;
  border:1px solid var(--border);
  background:var(--bg-3); color:var(--text); outline:none;
  font-size:clamp(14px,3.6vw,16px);
}
input:focus{
  border-color: color-mix(in srgb, var(--accent), white 10%);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--accent), transparent 80%);
  background: color-mix(in srgb, var(--bg-3), white 2%);
}
.row{ display:grid; gap:6px }
.hint{ font-size:12px; color:var(--muted); margin-top:8px }

/* ===== Callout ===== */
.callout{
  margin-top:10px; padding:10px 12px; border-radius:12px; display:none;
  border:1px solid transparent; font-size:clamp(12px,3.2vw,14px)
}
.callout.error{ color:#fee2e2; background:#7f1d1d; border-color:#fecaca33 }
.callout.ok{ color:#bbf7d0; background:#14532d; border-color:#22c55e33 }
.callout.show{ display:block }

/* ===== Footer ===== */
.footer{
  padding:12px 16px; text-align:center; font-size:12px; color:var(--muted);
  border-top:1px dashed var(--border)
}

/* ===== Link kecil ===== */
.link-btn{
  background:none; border:none; color:var(--muted);
  font-weight:400; text-decoration:underline; cursor:pointer;
}
.link-btn:hover{ color:var(--accent); }
.forgot-link, .register-link { text-align:center }

/* ===== Logo ===== */
.logo-wrap{ display:flex; justify-content:center; margin-bottom:12px }
.logo-wrap img{
  width:clamp(180px, 48vw, 300px);
  height:clamp(180px, 48vw, 300px);
  object-fit:contain; border-radius:16px; background:var(--bg-3);
  border:1px solid var(--border); padding:10px;
}
.logo-wrap img[data-loading="1"]{
  background: linear-gradient(90deg,var(--bg-3) 0%, #101733 50%, var(--bg-3) 100%);
  background-size:200% 100%; animation:shimmer 1.2s linear infinite;
}

/* ===== Password eye ===== */
.password-wrapper{ position:relative }
.password-wrapper input{ padding-right:44px }
.toggle-eye{
  position:absolute; right:10px; top:50%; transform:translateY(-50%);
  cursor:pointer; user-select:none;
  width:32px; height:32px; display:grid; place-items:center;
  border-radius:8px; color:var(--text);
}
.toggle-eye:active{ background:rgba(255,255,255,.06) }

/* ===== Loading Overlay ===== */
body.blur-bg > *:not(#loadingOverlay){
  filter:blur(5px); pointer-events:none; user-select:none; transition:filter .2s ease;
}
#loadingOverlay{
  position:fixed; inset:0; display:none;
  align-items:center; justify-content:center;
  background:rgba(5,10,20,.55); z-index:9999; backdrop-filter:blur(2px); padding:16px;
}
#loadingOverlay .load-card{
  background:var(--bg-3);
  border:1px solid var(--border);
  border-radius:16px;
  padding:20px;
  box-shadow:0 16px 40px rgba(0,0,0,.45);
  display:flex; align-items:center; justify-content:center;
}
#loadingOverlay .icon{
  width:48px; height:48px; border-radius:50%; display:inline-block; position:relative;
  border:5px solid rgba(255,255,255,.15);
  border-top-color:var(--accent);
  animation:spin .9s linear infinite;
}

/* ===== Offline sheet ===== */
.net-sheet{
  position:fixed; left:0; right:0; bottom:0; z-index:9999;
  background:var(--bg-3); color:var(--text);
  border-top:1px solid var(--border);
  padding:12px 14px; display:none; gap:10px; align-items:center;
}
.net-sheet.show{ display:flex; animation:slideUp .18s ease-out both }
.net-dot{ width:10px; height:10px; border-radius:50%; background:var(--danger) }
.net-msg{ flex:1; font-size:14px; line-height:1.3 }
.net-act{ display:flex; gap:8px }
.net-btn{
  background: linear-gradient(135deg,var(--accent),var(--accent-2));
  color:#fff; border:1px solid var(--border);
  padding:8px 10px; border-radius:10px; cursor:pointer
}

/* ===== Animations ===== */
@keyframes spin{ to{ transform:rotate(360deg) } }
@keyframes shimmer{ 0%{ background-position:0% 0 } 100%{ background-position:200% 0 } }
@keyframes slideUp{ from{transform:translateY(8px);opacity:.0} to{transform:none;opacity:1} }

/* ===== Responsif kecil (landscape pendek) ===== */
@media (max-height:520px) and (orientation:landscape){
  .section{ padding:16px }
  .logo-wrap{ margin-bottom:8px }
}

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

/* ===== Perangkat high-DPI: batas ukuran logo & ripple ===== */
@media (min-resolution: 3dppx) {
  .logo-wrap img{
    width:clamp(150px, 40vw, 240px);
    height:clamp(150px, 40vw, 240px);
  }
  .btn:active::after{ width:120px; height:120px; }
}
