/* Halaman masuk. Kiri: tanda brand dari titik (gate.js). Kanan: panel form.
   Warna = preset Tome Ame (literal: #1a4932 panggung, #133826 panel, #ffecca teks, #ffdd6f fokus, #ffb9ae salah).
   Ganti brand = cari-ganti kelima hex itu + font. */
#gate { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, .85fr);
  background: #1a4932; color: #ffecca; font-family: Rubik, system-ui, sans-serif; overflow: hidden; }
#gate[hidden] { display: none !important; }

.gate-art { position: relative; min-height: 0; overflow: hidden; }
#gate-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gate-q { position: absolute; left: clamp(24px, 5vw, 72px); bottom: clamp(24px, 7vh, 64px); margin: 0; pointer-events: none;
  font: 800 clamp(44px, 6.4vw, 104px)/.88 "Big Shoulders Stencil Display", Rubik, sans-serif; color: #ffecca;
  text-shadow: 0 2px 32px rgba(10, 30, 20, .55); }

.gate-panel { position: relative; display: grid; place-items: center; padding: 40px clamp(24px, 4vw, 64px);
  background: #133826; border-left: 1px solid rgba(255, 236, 202, .1); overflow-y: auto; }
.gate-form { width: 100%; max-width: 380px; }
.gate-logo svg { display: block; width: 108px; height: auto; color: #ffecca; fill: currentColor; margin-bottom: 44px; }
.gate-kicker { margin: 0 0 10px; font-size: 14px; font-weight: 500; color: #ffdd6f; }
.gate-form h1 { margin: 0 0 12px; font: 800 60px/.92 "Big Shoulders Stencil Display", Rubik, sans-serif; color: #ffecca; letter-spacing: .005em; max-width: none; }
.gate-lead { margin: 0 0 32px; font-size: 15px; line-height: 1.6; color: rgba(255, 236, 202, .78); }

.gate-field { display: block; margin: 0 0 18px; }
.gate-field > span:first-child { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 500; color: rgba(255, 236, 202, .82); }
.gate-form input { box-sizing: border-box; width: 100%; margin: 0; padding: 14px 15px; font: 400 16px Rubik, sans-serif; color: #ffecca;
  border-radius: 12px; border: 1px solid rgba(255, 236, 202, .26); background: rgba(255, 236, 202, .06);
  transition: border-color .2s, background .2s, box-shadow .2s; }
.gate-form input::placeholder { color: rgba(255, 236, 202, .45); }
.gate-form input:hover { border-color: rgba(255, 236, 202, .45); }
.gate-form input:focus { outline: none; border-color: #ffdd6f; background: rgba(255, 236, 202, .1); box-shadow: 0 0 0 3px rgba(255, 221, 111, .22); }
.gate-pw { position: relative; display: block; }
.gate-pw input { padding-right: 112px; }
.gate-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: rgba(255, 236, 202, .8); font: 500 13px Rubik, sans-serif; cursor: pointer; }
.gate-eye:hover { background: rgba(255, 236, 202, .1); color: #ffecca; }

#gate-err { min-height: 22px; margin: 0 0 10px; font-size: 14px; color: #ffb9ae; }
.gate-go { width: 100%; min-height: 52px; border: 0; border-radius: 12px; background: #ffecca; color: #1a4932; font: 600 16px Rubik, sans-serif;
  cursor: pointer; transition: background .2s, transform .15s; }
.gate-go:hover { background: #ffdd6f; }
.gate-go:active { transform: scale(.985); }
.gate-go[disabled] { cursor: progress; opacity: .82; }
.gate-note { margin: 18px 0 0; font-size: 13px; line-height: 1.5; color: rgba(255, 236, 202, .55); }
.gate-form :focus-visible { outline: 2px solid #ffdd6f; outline-offset: 3px; }
.gate-form input:focus-visible { outline: none; }

/* salah username/password: kolom memerah + form bergoyang sekali */
.gate-form.bad input { border-color: #ffb9ae; }
.gate-form.shake { animation: gate-shake .42s; }
@keyframes gate-shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }

/* satu momen masuk: isi form naik berurutan */
.gate-form > * { animation: gate-in .7s cubic-bezier(.2, .7, .2, 1) both; }
.gate-form > :nth-child(2) { animation-delay: .06s; } .gate-form > :nth-child(3) { animation-delay: .12s; }
.gate-form > :nth-child(4) { animation-delay: .18s; } .gate-form > :nth-child(5) { animation-delay: .24s; }
.gate-form > :nth-child(6) { animation-delay: .3s; } .gate-form > :nth-child(n+7) { animation-delay: .36s; }
@keyframes gate-in { from { opacity: 0; transform: translateY(14px); } }

/* sambil mengecek sesi: bunga sudah mulai, form baru muncul kalau belum login */
.checking .gate-form { visibility: hidden; }

@media (max-width: 820px) {
  #gate { grid-template-columns: minmax(0, 1fr); grid-template-rows: 38vh auto; overflow-y: auto; }
  .gate-panel { border-left: 0; border-top: 1px solid rgba(255, 236, 202, .1); place-items: start center; padding: 28px 20px 48px; overflow: visible; }
  .gate-q { left: 20px; bottom: 14px; font-size: 36px; }
  .gate-logo svg { width: 88px; margin-bottom: 24px; }
  .gate-form h1 { font-size: 48px; }
  .gate-lead { margin-bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) { .gate-form > *, .gate-form.shake { animation: none; } }
