/* Halaman masuk -- dipakai login.php (website) DAN layar masuk Apps Script
 * (bangun_appscript.py menempelkan berkas ini ke appscript/masuk.html).
 * Semua kelas berawalan .masuk- supaya tidak bentrok dengan CSS dashboard. */

.masuk-latar {
  position: fixed; inset: 0; z-index: 3000;
  display: grid; grid-template-rows: 1fr auto; place-items: center;
  padding: 20px 20px 0; overflow-y: auto;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #0f172a;
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(96, 165, 250, .45), transparent 60%),
    radial-gradient(760px 480px at 108% 108%, rgba(191, 219, 254, .40), transparent 60%),
    linear-gradient(155deg, #0b1f4d 0%, #1e3a8a 45%, #2563eb 100%);
}
/* Kisi halus di latar, memudar ke tepi. */
.masuk-latar::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

.masuk-kartu {
  position: relative; width: 100%; max-width: 880px;
  display: grid; grid-template-columns: 1.05fr 1fr;
  background: #fff; border-radius: 22px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(2, 6, 23, .45), 0 0 0 1px rgba(255, 255, 255, .08);
  animation: masuk-muncul .45s ease-out both;
}
@keyframes masuk-muncul { from { opacity: 0; transform: translateY(14px) scale(.985); } }

/* ── Panel merek (kiri) ── */
.masuk-merek {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 22px;
  padding: 42px 38px; color: #fff;
  background: linear-gradient(160deg, #2563eb 0%, #1d4ed8 35%, #1e3a8a 75%, #172554 100%);
}
.masuk-merek::before, .masuk-merek::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 70%);
}
.masuk-merek::before { width: 340px; height: 340px; right: -140px; top: -120px; }
.masuk-merek::after  { width: 260px; height: 260px; left: -110px; bottom: -120px; }
.masuk-logo {
  width: 52px; height: 52px; border-radius: 15px; flex: 0 0 52px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.05rem; letter-spacing: .5px;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.masuk-merek h1 { margin: 0; font-size: 1.7rem; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; }
.masuk-sub { margin-top: 6px; font-size: .9rem; opacity: .82; }
.masuk-tagline { margin: 0; font-size: .95rem; line-height: 1.55; opacity: .9; max-width: 34ch; }
.masuk-fitur { list-style: none; margin: auto 0 0; padding: 0; display: grid; gap: 12px; font-size: .86rem; }
.masuk-fitur li {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12);
}
.masuk-fitur svg { flex: 0 0 18px; opacity: .95; }

/* ── Formulir (kanan) ── */
.masuk-form { display: flex; flex-direction: column; justify-content: center; padding: 46px 42px; }
.masuk-form h2 { margin: 0 0 6px; font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em; }
.masuk-petunjuk { margin: 0 0 24px; color: #64748b; font-size: .9rem; line-height: 1.5; }

.masuk-info, .masuk-galat {
  display: none; align-items: flex-start; gap: 9px;
  margin-bottom: 16px; padding: 10px 12px; border-radius: 11px;
  font-size: .84rem; line-height: 1.45;
}
.masuk-info.tampil, .masuk-galat.tampil { display: flex; }
.masuk-info  { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.masuk-galat { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; margin: 12px 0 0; }
.masuk-info svg, .masuk-galat svg { flex: 0 0 16px; margin-top: 1px; }

.masuk-form label { display: block; margin-bottom: 8px; font-size: .82rem; font-weight: 600; color: #334155; }
.masuk-isian { position: relative; }
.masuk-isian > svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: #94a3b8; pointer-events: none;
}
.masuk-isian input {
  width: 100%; height: 48px; padding: 0 48px 0 42px; box-sizing: border-box;
  border: 1.5px solid #cbd5e1; border-radius: 12px; background: #f8fafc;
  font: inherit; font-size: 1rem; color: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.masuk-isian input:focus {
  outline: none; background: #fff; border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .15);
}
.masuk-mata {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border: 0; border-radius: 9px; background: transparent;
  display: grid; place-items: center; color: #64748b; cursor: pointer;
}
.masuk-mata:hover { background: #eef2ff; color: #1d4ed8; }
.masuk-mata .tutup { display: none; }
.masuk-mata.buka .buka-ikon { display: none; }
.masuk-mata.buka .tutup { display: block; }

.masuk-tombol {
  margin-top: 18px; width: 100%; height: 48px; border: 0; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font: inherit; font-size: .98rem; font-weight: 700; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #1d4ed8 55%, #1e40af);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .35);
  transition: transform .12s, box-shadow .15s, filter .15s;
}
.masuk-tombol:hover { filter: brightness(1.06); box-shadow: 0 14px 30px rgba(37, 99, 235, .42); }
.masuk-tombol:active { transform: translateY(1px); }
.masuk-tombol:disabled { cursor: wait; filter: saturate(.7); }
.masuk-putar {
  display: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: masuk-putar .7s linear infinite;
}
.masuk-tombol.proses .masuk-putar { display: block; }
.masuk-tombol.proses .masuk-panah { display: none; }
@keyframes masuk-putar { to { transform: rotate(360deg); } }

.masuk-kaki {
  margin-top: 22px; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: .76rem; color: #94a3b8; text-align: center;
}
/* Kaki halaman (sama dengan Cek CAWI & portal): garis tipis selebar layar,
 * satu baris redup, di dasar layar. Baris grid sendiri -- di layar pendek ikut
 * turun di bawah kartu, tidak menimpanya. */
.masuk-hak {
  position: relative; align-self: end; justify-self: stretch;
  margin: 24px -20px 0; padding: 16px 20px 20px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  text-align: center; font-size: .8rem; color: rgba(255, 255, 255, .7);
}

/* ── Ponsel: satu kartu, panel merek jadi kepala ringkas ── */
@media (max-width: 760px) {
  .masuk-kartu { grid-template-columns: 1fr; max-width: 420px; border-radius: 20px; }
  .masuk-merek { flex-direction: row; align-items: center; gap: 14px; padding: 22px 22px; }
  .masuk-merek h1 { font-size: 1.2rem; }
  .masuk-sub { margin-top: 2px; font-size: .8rem; }
  .masuk-tagline, .masuk-fitur { display: none; }
  .masuk-logo { width: 44px; height: 44px; flex-basis: 44px; border-radius: 13px; font-size: .95rem; }
  .masuk-form { padding: 28px 22px 26px; }
  .masuk-form h2 { font-size: 1.2rem; }
}

/* ── Mode gelap: ikut setelan perangkat atau tema dashboard ── */
@media (prefers-color-scheme: dark) {
  .masuk-latar:not(.masuk-terang) { color: #e2e8f0; }
  .masuk-latar:not(.masuk-terang) .masuk-kartu { background: #0f172a; box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(148, 163, 184, .15); }
  .masuk-latar:not(.masuk-terang) .masuk-petunjuk { color: #94a3b8; }
  .masuk-latar:not(.masuk-terang) .masuk-form label { color: #cbd5e1; }
  .masuk-latar:not(.masuk-terang) .masuk-isian input { background: #1e293b; border-color: #334155; }
  .masuk-latar:not(.masuk-terang) .masuk-isian input:focus { background: #0f172a; border-color: #60a5fa; box-shadow: 0 0 0 4px rgba(96, 165, 250, .2); }
  .masuk-latar:not(.masuk-terang) .masuk-mata:hover { background: #1e293b; color: #93c5fd; }
  .masuk-latar:not(.masuk-terang) .masuk-info { background: #172554; color: #bfdbfe; border-color: #1e3a8a; }
  .masuk-latar:not(.masuk-terang) .masuk-galat { background: #450a0a; color: #fecaca; border-color: #7f1d1d; }
}

@media (prefers-reduced-motion: reduce) {
  .masuk-kartu, .masuk-putar { animation: none; }
}
