/* =====================================================================
   Halaman Login SIB — layout & komponen khusus.
   Dimuat HANYA di pages/login.blade.php, setelah bizplus-custom.css.
   Semua kelas diberi prefix .bp-auth* supaya tidak bentrok dengan
   demo_1/style.css (tema NobleUI) maupun override global Bizplus.
   Mobile-first: aturan dasar untuk HP, lalu di-upgrade di tablet/desktop.
   ===================================================================== */

:root {
  --bpa-primary: #c41e3a;
  --bpa-primary-600: #a3162e;
  --bpa-primary-700: #7e1022;
  --bpa-ink: #111827;
  --bpa-muted: #6b7280;
  --bpa-border: #e2e6ef;
  --bpa-field-bg: #ffffff;
  --bpa-radius: 16px;
  /* Tinggi viewport: 100dvh menghitung bilah URL browser HP yang
     menyusut/muncul; 100vh dipakai browser lama sebagai cadangan. */
  --bpa-vh: 100vh;
}

@supports (height: 100dvh) {
  :root { --bpa-vh: 100dvh; }
}

/* ------------------------------- Shell ------------------------------ */
body.bp-auth-body {
  min-height: var(--bpa-vh);
  margin: 0;
  background-color: #f5f6fa;
  background-image:
    radial-gradient(1100px 520px at 12% -10%, rgba(196, 30, 58, 0.16), transparent 60%),
    radial-gradient(900px 480px at 105% 110%, rgba(26, 17, 21, 0.14), transparent 62%);
  background-attachment: fixed;
}

.bp-auth {
  min-height: var(--bpa-vh);
  display: flex;
  align-items: center;
  justify-content: center;
  /* env(safe-area-*) menjaga konten tetap di luar notch / home indicator iOS */
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
}

.bp-auth__card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--bpa-radius);
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.14), 0 2px 6px rgba(16, 24, 40, 0.06);
  overflow: hidden;
}

/* --------------------------- Panel brand ---------------------------- */
.bp-auth__brand {
  background: linear-gradient(145deg, #1a1115 0%, #6d1223 58%, #c41e3a 130%);
  color: #fff;
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.bp-auth__logo {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  padding: 3px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  display: block;
}

.bp-auth__brand-name {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.3;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.bp-auth__brand-sub {
  margin: 3px 0 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.78);
}

.bp-auth__brand-points { display: none; }

/* --------------------------- Panel form ----------------------------- */
.bp-auth__form-wrap {
  padding: 24px 20px calc(22px + env(safe-area-inset-bottom));
}

.bp-auth__title {
  margin: 0 0 4px;
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--bpa-ink);
  letter-spacing: -0.02em;
}

.bp-auth__subtitle {
  margin: 0 0 18px;
  font-size: 0.875rem;
  color: var(--bpa-muted);
}

.bp-auth__field { margin-bottom: 14px; }

.bp-auth__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
}

.bp-auth__control { position: relative; }

.bp-auth__icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #9aa3b2;
  pointer-events: none;
}

/* Input: font-size 16px wajib — di bawah itu Safari iOS auto-zoom saat fokus. */
.bp-auth__input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--bpa-ink);
  background-color: var(--bpa-field-bg);
  border: 1px solid var(--bpa-border);
  border-radius: 12px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bp-auth__input::placeholder { color: #aab2c0; }

.bp-auth__input:hover { border-color: #ccd3e0; }

.bp-auth__input:focus {
  outline: none;
  border-color: var(--bpa-primary);
  box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.14);
}

.bp-auth__input--password { padding-right: 48px; }

.bp-auth__input.is-invalid,
.bp-auth__input.is-invalid:focus {
  border-color: #e0475b;
  /* latar merah muda supaya field bermasalah tidak tertukar dengan
     field yang sekadar sedang fokus (warna brand juga merah) */
  background-color: #fffafb;
  box-shadow: 0 0 0 3px rgba(224, 71, 91, 0.14);
}

/* Tombol lihat/sembunyikan password */
.bp-auth__toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8b93a3;
  cursor: pointer;
}

.bp-auth__toggle:hover { color: var(--bpa-primary-600); background: #f4f5f9; }

.bp-auth__toggle:focus-visible {
  outline: 2px solid var(--bpa-primary);
  outline-offset: 1px;
}

.bp-auth__toggle svg { width: 18px; height: 18px; }

/* Petunjuk Caps Lock */
.bp-auth__hint {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  font-size: 0.775rem;
  color: #92561a;
  background: #fff6e6;
  border: 1px solid #ffe3b0;
  border-radius: 9px;
  padding: 6px 9px;
}

.bp-auth__hint.is-visible { display: flex; }

.bp-auth__hint svg { width: 14px; height: 14px; flex: 0 0 auto; }

/* ---------------------------- Remember me --------------------------- */
.bp-auth__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 18px;
  flex-wrap: wrap;
}

.bp-auth__check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 0.86rem;
  color: #374151;
  cursor: pointer;
  /* target sentuh minimal 44px tinggi untuk jari */
  min-height: 32px;
  -webkit-tap-highlight-color: transparent;
}

.bp-auth__check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--bpa-primary);
  cursor: pointer;
  flex: 0 0 auto;
}

.bp-auth__help {
  font-size: 0.8rem;
  color: var(--bpa-muted);
}

/* ------------------------------ Alert ------------------------------- */
.bp-auth__alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 16px;
  padding: 11px 13px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #8d1f2f;
  background: #fdecef;
  border: 1px solid #f7c6ce;
  border-radius: 12px;
}

.bp-auth__alert svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }
.bp-auth__alert p { margin: 0; }
.bp-auth__alert p + p { margin-top: 3px; }

/* ------------------------------ Tombol ------------------------------ */
.bp-auth__submit {
  position: relative;
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  font-size: 0.98rem;
  font-weight: 600;
  color: #fff;
  background-image: linear-gradient(135deg, #c41e3a 0%, #e23d4f 100%);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(196, 30, 58, 0.26);
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.bp-auth__submit:hover { filter: brightness(1.04); box-shadow: 0 10px 24px rgba(196, 30, 58, 0.32); }
.bp-auth__submit:active { transform: translateY(1px); box-shadow: 0 5px 14px rgba(196, 30, 58, 0.26); }

.bp-auth__submit:focus-visible {
  outline: 2px solid var(--bpa-primary-700);
  outline-offset: 2px;
}

.bp-auth__submit[disabled] {
  cursor: progress;
  filter: saturate(0.85) brightness(0.98);
  box-shadow: none;
}

.bp-auth__spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: bp-auth-spin 0.7s linear infinite;
}

.bp-auth__submit.is-loading .bp-auth__spinner { display: block; }

@keyframes bp-auth-spin { to { transform: rotate(360deg); } }

/* ------------------------------ Footer ------------------------------ */
.bp-auth__footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #eef0f5;
  font-size: 0.76rem;
  line-height: 1.5;
  color: #9099a8;
  text-align: center;
}

.bp-auth__footer a { color: var(--bpa-primary-600); text-decoration: none; }
.bp-auth__footer a:hover { text-decoration: underline; }

/* ====================== Tablet (>= 576px) =========================== */
@media (min-width: 576px) {
  .bp-auth { padding: 32px 24px; }
  .bp-auth__card { max-width: 480px; }
  .bp-auth__brand { padding: 26px 28px; gap: 16px; }
  .bp-auth__logo { width: 62px; height: 62px; }
  .bp-auth__brand-name { font-size: 1.12rem; }
  .bp-auth__form-wrap { padding: 30px 32px 26px; }
  .bp-auth__title { font-size: 1.42rem; }
}

/* ============ Desktop / tablet landscape (>= 992px) ================= */
@media (min-width: 992px) {
  .bp-auth { padding: 40px 24px; }

  .bp-auth__card {
    max-width: 940px;
    display: grid;
    grid-template-columns: 5fr 6fr;
    align-items: stretch;
  }

  .bp-auth__brand {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    padding: 44px 40px;
  }

  .bp-auth__logo { width: 76px; height: 76px; margin-bottom: 22px; }
  .bp-auth__brand-name { font-size: 1.5rem; line-height: 1.25; }
  .bp-auth__brand-sub { font-size: 0.9rem; margin-top: 10px; max-width: 30ch; }

  .bp-auth__brand-points {
    display: block;
    list-style: none;
    margin: 26px 0 0;
    padding: 0;
    width: 100%;
  }

  .bp-auth__brand-points li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.82);
  }

  .bp-auth__brand-points li + li { margin-top: 11px; }

  .bp-auth__brand-points svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    color: #ffb3bf;
  }

  .bp-auth__form-wrap {
    padding: 48px 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .bp-auth__title { font-size: 1.6rem; }
  .bp-auth__subtitle { margin-bottom: 24px; }
  .bp-auth__footer { text-align: left; }
}

/* ===== Layar pendek (HP landscape): rapatkan supaya form tetap muat === */
@media (max-height: 560px) and (max-width: 991.98px) {
  .bp-auth { align-items: flex-start; }
  .bp-auth__brand { padding: 14px 18px; }
  .bp-auth__logo { width: 42px; height: 42px; }
  .bp-auth__brand-sub { display: none; }
  .bp-auth__form-wrap { padding: 18px 20px 20px; }
  .bp-auth__subtitle { margin-bottom: 12px; }
  .bp-auth__field { margin-bottom: 11px; }
}

/* --------------------- Preferensi aksesibilitas --------------------- */
@media (prefers-reduced-motion: reduce) {
  .bp-auth__submit,
  .bp-auth__input { transition: none; }
  .bp-auth__spinner { animation-duration: 2s; }
}

@media (prefers-contrast: more) {
  .bp-auth__input { border-color: #6b7280; }
  .bp-auth__subtitle, .bp-auth__help { color: #4b5563; }
}

/* ------------------------------ Tipografi ---------------------------
   Halaman login sengaja TIDAK memuat demo_1/style.css & bizplus-custom.css
   (total >1 MB CSS tema) supaya cepat di jaringan HP, jadi font-stack-nya
   didefinisikan di sini. Inter dimuat dari Google Fonts; kalau gagal,
   font sistem yang dipakai — tampilan tetap utuh.                      */
body.bp-auth-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  color: var(--bpa-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.bp-auth * { box-sizing: border-box; }
