/* Layout bersama untuk halaman Registrasi & Login */
.auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ---------- Panel kiri ---------- */
.auth__side {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 5.5rem 2.5rem 3.5rem;
  color: #fff;
  text-align: center;
  background: linear-gradient(180deg, #021a62 0%, #1f4aa8 55%, #6b95ff 100%);
  overflow: hidden;
}
.auth__side .dots { inset: 0; color: #fff; opacity: .18; background-size: 12px 12px;
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 70%);
          mask-image: linear-gradient(90deg, #000, transparent 70%); }

.auth__back {
  position: absolute;
  top: 1.9rem;
  left: 2.3rem;
  z-index: 2;
}

.auth__headline {
  position: relative;
  z-index: 1;
  font-size: clamp(2.4rem, 4.4vw, 3.8rem);
  color: #fff;
}
.auth__headline .accent {
  background: linear-gradient(90deg, #d6f5ea, #8fb5ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth__art { position: relative; z-index: 1; width: min(78%, 400px); margin: 1.5rem 0; }

.auth__caption { position: relative; z-index: 1; font-size: 1.35rem; font-weight: 300; line-height: 1.5; }

/* ---------- Panel kanan ---------- */
.auth__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.2rem 2.5rem 2rem;
  background: #fff;
}
.auth__inner { width: min(100%, 470px); }

/* Stepper */
.stepper { display: flex; gap: .9rem; list-style: none; margin-bottom: 1.4rem; }
.step { flex: 1; }
.step__bar { display: block; height: 12px; border-radius: 999px; background: var(--line); transition: background .3s ease; }
.step__label { display: flex; align-items: center; gap: .35rem; margin-top: .3rem; font-size: .95rem; color: var(--ink); white-space: nowrap; }
.step__num {
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: .68rem; font-weight: 600;
  background: #ddd; color: var(--ink);
}
.step.is-active .step__bar,
.step.is-done .step__bar,
.step.is-error .step__bar { background: var(--grad-brand); }
.step.is-active .step__label { color: var(--navy-700); }
.step.is-active .step__num { background: var(--blue-600); color: #fff; }
.step.is-done .step__label { color: var(--ok); }
.step.is-done .step__num { background: var(--ok); color: #fff; }
.step.is-error .step__label { color: var(--err); }
.step.is-error .step__num { background: var(--err); color: #fff; }

.auth__title { font-size: 2.1rem; text-align: center; margin-bottom: 1.4rem; color: #000; }

.auth__desc { color: var(--muted); font-size: .92rem; line-height: 1.55; margin-bottom: 1.1rem; }

/* Form */
.field { margin-bottom: 1.05rem; }
.field__label { display: block; margin-bottom: .45rem; font-size: .98rem; font-weight: 500; }
.field__box {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: 0 1rem;
  height: 62px;
  border: 3px solid var(--line);
  border-radius: 18px;
  color: #b5b0b2;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field__box:focus-within { border-color: var(--blue-400); box-shadow: 0 0 0 4px rgba(107, 149, 255, .18); color: var(--blue-600); }
.field__box input { flex: 1; min-width: 0; height: 100%; font-size: 1rem; color: var(--ink); border: 0; outline: 0; background: transparent; }
.field__box input::placeholder { color: #d4d0d1; }
.field.has-error .field__box { border-color: var(--err); }
.field__error { display: none; margin-top: .3rem; font-size: .8rem; color: var(--err); }
.field.has-error .field__error { display: block; }

.auth__foot { margin-top: 1.1rem; text-align: center; font-size: .9rem; color: var(--muted); }
.auth__foot--left { text-align: center; }
.auth__links { margin-top: 1.2rem; display: flex; flex-direction: column; gap: .8rem; align-items: center; font-size: .92rem; }

.demo-hint {
  margin-top: 1.4rem;
  padding: .6rem .9rem;
  font-size: .78rem;
  color: var(--navy-700);
  background: var(--blue-100);
  border-radius: 12px;
  text-align: center;
}

/* Area wajah (kamera) */
.face {
  position: relative;
  width: 290px;
  height: 290px;
  margin: 1rem auto 1.1rem;
  display: grid;
  place-items: center;
  color: #8a8a93;
  font-size: 1.05rem;
  border: 4px solid var(--line);
  border-radius: 50%;
  overflow: hidden;
  background: #fafbff;
}
.face.is-scanning { border-color: var(--blue-400); }
.face.is-scanning::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0; height: 36%;
  background: linear-gradient(180deg, transparent, rgba(107, 149, 255, .45), transparent);
  animation: scan 1.4s ease-in-out infinite;
}
@keyframes scan { 0% { transform: translateY(-100%); } 100% { transform: translateY(300%); } }

.tips { list-style: none; color: var(--muted); font-size: .92rem; line-height: 1.55; margin-bottom: 1.5rem; padding-left: .2rem; }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth__side { padding: 5rem 1.5rem 2rem; }
  .auth__art { width: 220px; }
  .auth__caption { font-size: 1.05rem; }
}

/* ---------- Kamera (ditambahkan untuk Laravel + face-api.js) ---------- */
.face video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* efek cermin */
}
.face.is-live { border-color: var(--blue-400); box-shadow: 0 0 0 6px rgba(107, 149, 255, .18); }
.face.is-scanning::after { z-index: 1; }

.face-status { min-height: 1.3rem; margin: -.4rem 0 .9rem; text-align: center; font-size: .88rem; color: var(--blue-600); }
.face-status.is-error { color: var(--err); }
.face-status.is-ok { color: var(--ok); }

/* Perbaikan layar HP: label stepper tidak melebarkan halaman, tombol Beranda tidak menimpa judul */
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .auth__side { padding-top: 5.5rem; }
  .auth__headline { font-size: 2.1rem; }
  .auth__main { padding: 1.8rem 1rem 2rem; }
  .stepper { gap: .5rem; }
  .step { min-width: 0; }
  .step__label { font-size: .72rem; white-space: normal; line-height: 1.25; align-items: flex-start; }
  .step__num { flex: none; margin-top: 1px; }
  .otp { gap: .4rem; }
  .face { width: 240px; height: 240px; }
}

/* ---------- Revisi: liveness & validasi wajah ---------- */
.face__overlay {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transform: scaleX(-1); pointer-events: none; z-index: 2;
}
.face-status.is-action { color: var(--navy-700); font-weight: 600; font-size: .95rem; }

.liveness { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem .5rem; margin: 0 0 1rem; }
.liveness:empty { display: none; }
.liveness li {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .65rem; font-size: .78rem; color: var(--muted);
  background: #f4f6fb; border: 1px solid var(--line); border-radius: 999px;
}
.liveness__dot { width: 8px; height: 8px; border-radius: 50%; background: #cfd3dd; }
.liveness li.is-active { color: var(--navy-700); border-color: var(--blue-400); background: var(--blue-100); }
.liveness li.is-active .liveness__dot { background: var(--blue-500); animation: pulse 1s ease-in-out infinite; }
.liveness li.is-done { color: var(--ok); border-color: #a8d8ad; background: var(--ok-soft); }
.liveness li.is-done .liveness__dot { background: var(--ok); }
@keyframes pulse { 50% { transform: scale(1.6); opacity: .5; } }

.face-debug {
  margin: 0 0 1rem; padding: .6rem .8rem; font-size: .72rem; line-height: 1.5;
  white-space: pre-wrap; color: #e7ecff; background: #0b1533; border-radius: 10px;
}

/* Layar kedip warna untuk cek pantulan (anti video di layar HP) */
.flash-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 8vh; background: #ff0000;
}
.flash-overlay p {
  margin: 0; padding: .7rem 1.2rem; border-radius: 12px;
  font-size: .95rem; line-height: 1.5; text-align: center;
  color: #fff; background: rgba(0, 0, 0, .55);
}
