/**
 * Halaman login publik (index.php, admin.php) – desktop & mobile
 */

html.auth-public-root {
  color-scheme: light;
}

:root {
  --auth-visual-gradient: linear-gradient(135deg, #5156be 0%, #2d9cdb 50%, #1a7f4e 100%);
  --auth-card-bg: rgba(255, 255, 255, 0.98);
  --auth-card-shadow: 0 24px 48px rgba(18, 38, 63, 0.12);
  --auth-radius: 1rem;
  --auth-max-card: 420px;
}

.auth-page.auth-modern {
  min-height: 100dvh;
  background: var(--auth-shell-bg, #eef1f6);
}

/* Login publik: paksa tampilan terang (abaikan dark dari panel admin / localStorage) */
body.auth-public {
  background-color: #eef1f6 !important;
  color: #495057 !important;
}

body.auth-public .auth-modern__title h1,
body.auth-public h1,
body.auth-public h2,
body.auth-public h5 {
  color: #343a40 !important;
}

body.auth-public .form-control,
body.auth-public .form-select,
body.auth-public .input-group-text {
  background-color: #fff !important;
  border-color: #ced4da !important;
  color: #212529 !important;
}

body.auth-public .form-control::placeholder {
  color: #adb5bd !important;
}

body.auth-public .btn-light {
  background-color: #f8f9fa !important;
  border-color: #ced4da !important;
  color: #495057 !important;
}

body.auth-public .auth-modern__card {
  --auth-card-bg: rgba(255, 255, 255, 0.98);
  --auth-card-shadow: 0 24px 48px rgba(18, 38, 63, 0.12);
  border-color: rgba(0, 0, 0, 0.06) !important;
}

body.auth-public .auth-modern__footer {
  border-top-color: rgba(0, 0, 0, 0.06) !important;
  color: #6c757d !important;
}

body.auth-public .auth-modern__badge {
  background: rgba(var(--bs-primary-rgb, 81, 86, 190), 0.12) !important;
  color: var(--bs-primary, #5156be) !important;
}

body.auth-public .auth-modern__subtitle {
  color: #6c757d !important;
}

.auth-modern__wrap {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: 1fr;
}

@media (min-width: 992px) {
  .auth-modern__wrap {
    grid-template-columns: minmax(380px, 42%) 1fr;
  }
}

/* Panel visual (kanan di desktop, atas di mobile) */
.auth-modern__visual {
  position: relative;
  min-height: clamp(140px, 28vh, 280px);
  background: var(--auth-visual-gradient);
  background-image: var(--auth-visual-gradient), url("../images/auth-bg.jpg");
  background-position: center;
  background-size: cover;
  background-blend-mode: overlay;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

@media (min-width: 992px) {
  .auth-modern__visual {
    min-height: 100dvh;
    order: 2;
    align-items: center;
    justify-content: center;
  }
}

.auth-modern__visual .bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(81, 86, 190, 0.75), rgba(45, 156, 219, 0.55));
  opacity: 1;
}

.auth-modern__visual-caption {
  position: relative;
  z-index: 2;
  color: #fff;
  max-width: 28rem;
}

.auth-modern__visual-caption h2 {
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.auth-modern__visual-caption p {
  margin: 0;
  opacity: 0.92;
  font-size: clamp(0.875rem, 2.5vw, 1rem);
  line-height: 1.5;
}

.auth-modern__visual .bg-bubbles {
  z-index: 1;
}

/* Panel form */
.auth-modern__main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 5vw, 2.5rem);
  padding-bottom: calc(clamp(1.25rem, 5vw, 2.5rem) + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 992px) {
  .auth-modern__main {
    order: 1;
  }
}

.auth-modern__card {
  width: 100%;
  max-width: var(--auth-max-card);
  background: var(--auth-card-bg);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-card-shadow);
  padding: clamp(1.5rem, 5vw, 2rem);
  border: 1px solid rgba(0, 0, 0, 0.06);
  animation: authCardIn 0.4s ease-out;
}

@keyframes authCardIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-modern__card {
    animation: none;
  }
}

.auth-modern__logo {
  display: block;
  text-align: center;
  margin-bottom: 1.25rem;
}

.auth-modern__logo img {
  max-width: min(200px, 70vw);
  height: auto;
  object-fit: contain;
}

.auth-modern__title {
  text-align: center;
  margin-bottom: 0.25rem;
}

.auth-modern__title h1 {
  font-size: clamp(1.15rem, 4vw, 1.35rem);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.auth-modern__subtitle {
  text-align: center;
  color: var(--bs-secondary-color, #6c757d);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.auth-modern .form-label {
  font-weight: 600;
  font-size: 0.875rem;
}

.auth-modern .form-control {
  min-height: 48px;
  font-size: 1rem;
}

.auth-modern .input-group .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.auth-modern .auth-pass-inputgroup .btn {
  min-width: 48px;
  min-height: 48px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-modern .form-error {
  display: block;
  font-size: 0.8125rem;
  margin-top: 0.35rem;
}

.auth-modern .btn-primary {
  min-height: 48px;
  font-size: 1rem;
}

.auth-modern__links {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.auth-modern__links p {
  margin-bottom: 0.5rem;
}

.auth-modern__links a {
  font-weight: 600;
  text-decoration: none;
}

.auth-modern__links a:hover {
  text-decoration: underline;
}

.auth-modern__footer {
  text-align: center;
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.8125rem;
  color: var(--bs-secondary-color, #6c757d);
}

.auth-modern__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(var(--bs-primary-rgb, 81, 86, 190), 0.12);
  color: var(--bs-primary, #5156be);
  margin-bottom: 1rem;
}

/* Registrasi pelanggan (registrasi.php) */
.auth-modern--register .auth-modern__card {
  max-width: min(480px, 100%);
}

.auth-modern--register.auth-modern--maps .auth-modern__card {
  max-width: min(540px, 100%);
  animation: none;
}

.auth-modern__steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.auth-modern__step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #adb5bd;
}

.auth-modern__step-num {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e9ecef;
  color: #6c757d;
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.auth-modern__step.is-active {
  color: var(--bs-primary, #5156be);
}

.auth-modern__step.is-active .auth-modern__step-num {
  background: var(--bs-primary, #5156be);
  color: #fff;
}

.auth-modern__step.is-done {
  color: #1a7f4e;
}

.auth-modern__step.is-done .auth-modern__step-num {
  background: rgba(26, 127, 78, 0.15);
  color: #1a7f4e;
}

.auth-modern__step-divider {
  width: 2rem;
  height: 2px;
  background: #dee2e6;
  flex-shrink: 0;
}

.auth-modern__field {
  position: relative;
  margin-bottom: 1rem;
}

.auth-modern__field .form-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}

.auth-modern__field .form-label i {
  font-size: 1.05rem;
  color: var(--bs-primary, #5156be);
  opacity: 0.85;
}

.auth-modern__field .form-control,
.auth-modern__field .form-select {
  min-height: 48px;
  border-radius: 0.625rem;
  padding-left: 0.875rem;
}

.auth-modern__field textarea.form-control {
  min-height: 96px;
  padding-top: 0.75rem;
}

.auth-modern__hint {
  display: block;
  font-size: 0.8125rem;
  color: #6c757d;
  margin-top: 0.35rem;
}

.auth-modern__map-card {
  border-radius: var(--auth-radius);
  overflow: visible;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  box-shadow: 0 4px 16px rgba(18, 38, 63, 0.06);
}

.auth-modern__map-card #map {
  display: block;
  border-radius: 0;
  margin-bottom: 0;
}

.auth-modern__map-header {
  padding: 1rem 1.125rem;
  background: linear-gradient(135deg, rgba(81, 86, 190, 0.08), rgba(45, 156, 219, 0.06));
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.auth-modern__map-header h6 {
  margin: 0 0 0.25rem;
  font-weight: 700;
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.auth-modern__map-header p {
  margin: 0;
  font-size: 0.8125rem;
  color: #6c757d;
  line-height: 1.45;
}

.auth-modern__map-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem 1.125rem 1.5rem;
  margin-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.auth-modern__map-footer .btn {
  width: 100%;
  min-height: 48px;
  border-radius: 0.625rem;
  font-weight: 600;
  margin: 0;
}

.auth-modern__loc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(26, 127, 78, 0.12);
  color: #1a7f4e;
  margin-bottom: 1rem;
}

.auth-modern__btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.auth-modern__btn-group .btn {
  width: 100%;
  min-height: 48px;
  border-radius: 0.625rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0 !important;
}

.auth-modern__field:last-of-type {
  margin-bottom: 0.25rem;
}

/* Login pelanggan (index.php) — mobile: tanpa banner gambar, bisa scroll */
@media (max-width: 991.98px) {
  html.auth-public-root,
  body.auth-pelanggan-login {
    height: auto !important;
    min-height: 100dvh;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .auth-modern--pelanggan.auth-page {
    min-height: auto;
  }

  .auth-modern--pelanggan .auth-modern__wrap {
    display: block;
    min-height: auto;
  }

  .auth-modern--pelanggan .auth-modern__visual {
    display: none !important;
  }

  .auth-modern--pelanggan .auth-modern__main {
    align-items: flex-start;
    justify-content: flex-start;
    min-height: auto;
    padding: 1rem 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }

  .auth-modern--pelanggan .auth-modern__card {
    max-width: 100%;
    margin: 0 auto;
  }
}
