/* Halaman pilih perusahaan & cabang — satu layar penuh, tanpa scroll */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; overflow: hidden; }

body.gateway {
  font-family: "Heebo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #fff;
  background: #0d1b33 url("../images/bg.jpg") center / cover no-repeat;
  -webkit-font-smoothing: antialiased;
}

.gateway-overlay {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(14px, 4vw, 28px);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(30, 60, 120, .35) 0%, rgba(8, 18, 38, 0) 60%),
    linear-gradient(180deg, rgba(8, 18, 38, .55) 0%, rgba(8, 18, 38, .78) 100%);
}

.gateway-main {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(14px, 5vh, 56px) 0 clamp(10px, 2.5vh, 24px);
  display: flex;
  flex-direction: column;
}

.gateway-head { flex: none; text-align: center; margin-bottom: clamp(12px, 3.5vh, 32px); }
.gateway-head h1 {
  margin: 0 0 4px;
  font-size: clamp(1.4rem, 1rem + 2vh, 2.1rem);
  font-weight: 700;
  letter-spacing: -.02em;
}
.gateway-head p { margin: 0; font-size: clamp(.85rem, .7rem + .6vh, 1rem); color: rgba(255, 255, 255, .75); }

.gateway-back {
  position: absolute;
  top: clamp(10px, 3vh, 28px);
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #fff;
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .2s ease, transform .15s ease;
}
.gateway-back:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.gateway-back:active { transform: scale(.96); }

.gateway-alert {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  max-width: 460px;
  width: 100%;
  margin: 0 auto 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 59, 48, .22);
  border: 1px solid rgba(255, 120, 110, .5);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #fff;
  font-size: .9rem;
}
.gateway-alert button { border: 0; background: none; color: inherit; font-size: 1.2rem; line-height: 1; cursor: pointer; }

/* Kisi mengisi sisa tinggi layar; baris dibagi rata */
.gateway-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 240px);
  align-content: center;
  gap: clamp(10px, 2.4vh, 18px);
}

.gateway-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.8vh, 14px);
  padding: 10px 12px;
  border-radius: clamp(20px, 3.2vh, 28px);
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .25);
  color: #fff;
  text-align: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), background .2s ease, box-shadow .2s ease;
  animation: gw-in .5s cubic-bezier(.2, .8, .2, 1) both;
}
.gateway-card:hover { background: rgba(255, 255, 255, .22); transform: translateY(-2px) scale(1.015); color: #fff; }
.gateway-card:active { transform: scale(.97); background: rgba(255, 255, 255, .18); }
.gateway-card:focus-visible { outline: 3px solid rgba(255, 255, 255, .85); outline-offset: 3px; color: #fff; }

/* Logo seperti ikon aplikasi iOS */
.gateway-card .logo {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(52px, 14vh, 92px);
  aspect-ratio: 1;
  border-radius: 23%;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .22);
}
.gateway-card .logo img { display: block; width: 76%; height: 76%; object-fit: contain; }
.gateway-card.area .logo img { width: 66%; height: 66%; }

.gateway-card .name {
  max-width: 100%;
  font-size: clamp(.8rem, .62rem + .75vh, 1.05rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  overflow-wrap: anywhere;
}

.gateway-grid .gateway-card:nth-child(2) { animation-delay: .05s; }
.gateway-grid .gateway-card:nth-child(3) { animation-delay: .1s; }
.gateway-grid .gateway-card:nth-child(4) { animation-delay: .15s; }
.gateway-grid .gateway-card:nth-child(n+5) { animation-delay: .2s; }

.gateway-foot {
  flex: none;
  padding: 6px 0 clamp(8px, 2vh, 18px);
  text-align: center;
  font-size: .8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, .65);
}

@keyframes gw-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

/* Layar landscape pendek: empat kolom agar semua muat */
@media (max-height: 460px) and (min-width: 560px) {
  .gateway-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .gateway-card { animation: none; transition: none; }
  .gateway-card:hover, .gateway-card:active { transform: none; }
}

/* Fallback tanpa dukungan backdrop-filter */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .gateway-card { background: rgba(30, 45, 80, .78); }
}

/* ---------- Halaman login ---------- */
.login-main { justify-content: center; align-items: center; padding-top: clamp(10px, 3vh, 32px); }

.login-brand { flex: none; text-align: center; margin-bottom: clamp(12px, 3vh, 26px); }
.login-brand .logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(56px, 12vh, 84px);
  aspect-ratio: 1;
  border-radius: 23%;
  background: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
}
.login-brand .logo img { display: block; width: 76%; height: 76%; object-fit: contain; }
.login-brand h1 {
  margin: clamp(8px, 2vh, 16px) 0 0;
  font-size: clamp(1.15rem, .9rem + 1.3vh, 1.6rem);
  font-weight: 700;
  letter-spacing: -.01em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}

.login-card {
  flex: none;
  width: 100%;
  max-width: 400px;
  padding: clamp(18px, 3.5vh, 30px) clamp(18px, 5vw, 28px);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .25);
  animation: gw-in .5s cubic-bezier(.2, .8, .2, 1) both;
}
.login-card h2 { margin: 0 0 4px; font-size: 1.4rem; font-weight: 700; text-align: center; letter-spacing: -.01em; }
.login-card .lead { margin: 0 0 clamp(12px, 2.5vh, 20px); text-align: center; font-size: .9rem; color: rgba(255, 255, 255, .75); }

.login-field { position: relative; margin-bottom: 12px; }
.login-field input {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(255, 255, 255, .92);
  font: inherit;
  font-size: .875rem;
  color: #14213d;
  transition: box-shadow .2s ease, background .2s ease;
}
.login-field input::placeholder { color: #8a93a5; }
.login-field input:focus { outline: 0; background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .45); }
.login-field.has-toggle input { padding-right: 52px; }

.login-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #6b7488;
  cursor: pointer;
}
.login-toggle:hover { color: #14213d; background: rgba(0, 0, 0, .05); }
.login-toggle svg { width: 20px; height: 20px; }

.login-submit {
  width: 100%;
  height: 46px;
  margin-top: 6px;
  border: 0;
  border-radius: 14px;
  background: #2b5bd7;
  color: #fff;
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(43, 91, 215, .45);
  transition: transform .15s ease, background .2s ease, opacity .2s ease;
}
.login-submit:hover { background: #3a68e0; }
.login-submit:active { transform: scale(.98); }
.login-submit:disabled { opacity: .65; cursor: progress; }
.login-submit:focus-visible { outline: 3px solid rgba(255, 255, 255, .85); outline-offset: 2px; }

.login-msg {
  min-height: 0;
  margin-top: 12px;
  padding: 0;
  border-radius: 12px;
  font-size: .9rem;
  text-align: center;
}
.login-msg:not(:empty) { padding: 10px 12px; }
.login-msg.error { background: rgba(255, 59, 48, .28); border: 1px solid rgba(255, 120, 110, .55); }
.login-msg.ok { background: rgba(52, 199, 89, .28); border: 1px solid rgba(120, 220, 150, .55); }

.login-links { flex: none; margin-top: clamp(12px, 2.5vh, 20px); text-align: center; }
.login-links a { color: rgba(255, 255, 255, .85); font-size: .9rem; text-decoration: none; }
.login-links a:hover { color: #fff; text-decoration: underline; }

@media (max-height: 520px) {
  .login-main { flex-direction: row; gap: 28px; justify-content: center; }
  .login-brand { margin-bottom: 0; }
  .login-card { max-width: 360px; }
}

/* ---------- Login satu halaman: pilihan perusahaan & cabang ---------- */
.login-select { position: relative; margin-bottom: 12px; }
.login-select label {
  display: block;
  margin: 0 0 4px 6px;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .02em;
  color: rgba(255, 255, 255, .75);
}
.login-select select {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(255, 255, 255, .92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none' stroke='%236b7488' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center;
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  font-size: .875rem;
  color: #14213d;
  cursor: pointer;
  transition: box-shadow .2s ease, background-color .2s ease, opacity .2s ease;
}
.login-select select:focus { outline: 0; background-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .45); }
.login-select select:disabled { opacity: .6; cursor: not-allowed; }
.login-divider { height: 1px; margin: 4px 4px 14px; background: rgba(255, 255, 255, .2); }

.login-brand .logo img { transition: opacity .15s ease; }

@media (max-height: 700px) and (max-width: 560px) {
  .login-brand h1 { font-size: 1.05rem; }
  .login-card .lead { display: none; }
  .login-card { padding-top: 16px; padding-bottom: 16px; }
  .login-select select, .login-field input, .login-submit { height: 44px; }
}

/* Layar pendek (laptop kecil, HP landscape): padatkan form agar tetap satu layar */
@media (max-height: 640px) {
  .login-card .lead { display: none; }
  .login-card h2 { font-size: 1.2rem; margin-bottom: 10px; }
  .login-select { margin-bottom: 8px; }
  .login-select label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .login-select select, .login-field input, .login-submit { height: 40px; }
  .login-field { margin-bottom: 8px; }
  .login-divider { margin: 2px 4px 10px; }
  .login-brand .logo { width: clamp(44px, 9vh, 64px); }
  .login-brand h1 { font-size: 1.05rem; margin-top: 6px; }
  .login-card { padding: 14px 20px; }
}
@media (max-height: 520px) {
  .login-main { padding-top: 8px; padding-bottom: 6px; }
  .login-select select, .login-field input, .login-submit { height: 38px; font-size: .85rem; }
  .login-select, .login-field { margin-bottom: 6px; }
  .login-divider { display: none; }
  .login-card { padding: 12px 18px; }
  .login-card h2 { margin-bottom: 8px; }
  .login-links { margin-top: 6px; }
}
