/* ======================================================
   LOGIN PAGE — layout khusus halaman login mandiri.
   Komponen form (input, label, tombol, error) memakai
   class dari auth.css agar konsisten dengan popup login/register.
   Reuses BKKBISA design tokens dari assets/css/style.css.
====================================================== */

/* ======================================================
   AUTH MODALS (Login & Register) — extends style.css
   Reuses BKKBISA design tokens (--primary, --radius-*, --shadow-*)
   defined in assets/css/style.css. Do not redefine :root here.
====================================================== */

.auth-modal .modal-dialog {
  max-width: 440px;
}

.auth-modal-content {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gray-bg);
  border: none;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  z-index: 2;
  transition: all .2s;
}

.auth-modal-close:hover { background: #E8ECF2; color: var(--navy); }

.auth-modal-body {
  padding: 2.4rem 2.2rem 2rem;
}

.auth-modal-brand {
  text-align: center;
  margin-bottom: 1.2rem;
}

.auth-modal-brand img {
  max-width: 120px;
}

.auth-modal-title {
  text-align: center;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--navy);
  letter-spacing: -.3px;
  margin-bottom: .4rem;
}

.auth-modal-subtitle {
  text-align: center;
  color: var(--gray-600);
  font-size: .88rem;
  margin-bottom: 1.7rem;
}

/* ===== FORM FIELDS ===== */
.auth-field { margin-bottom: 1rem; }

.auth-label {
  display: block;
  font-weight: 700;
  font-size: .82rem;
  color: var(--navy);
  margin-bottom: .4rem;
}

.auth-input-wrap {
  display: flex;
  align-items: center;
  gap: .6rem;
  border: 1.5px solid var(--gray-border);
  border-radius: var(--radius-md);
  padding: .68rem .9rem;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}

.auth-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.auth-input-wrap i:first-child {
  color: var(--gray-500);
  font-size: 1rem;
  flex-shrink: 0;
}

.auth-input {
  border: none;
  outline: none;
  width: 100%;
  font-size: .9rem;
  color: var(--navy);
  background: transparent;
  font-family: inherit;
}

.auth-input::placeholder { color: var(--gray-400); }

.auth-toggle-pass {
  background: none;
  border: none;
  color: var(--gray-500);
  font-size: .95rem;
  padding: 0;
  flex-shrink: 0;
  cursor: pointer;
  transition: color .2s;
}

.auth-toggle-pass:hover { color: var(--primary); }

.auth-forgot-link {
  font-size: .8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: .4rem;
}

/* ===== ERROR MESSAGE ===== */
.auth-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #DC2626;
  border-radius: var(--radius-sm);
  padding: .65rem .85rem;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ===== SUBMIT BUTTON ===== */
.auth-submit-btn {
  width: 100%;
  justify-content: center;
  padding: .78rem 1rem;
  font-size: .92rem;
  font-weight: 700;
  margin-top: .3rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.auth-submit-btn:disabled { opacity: .7; cursor: not-allowed; }

.auth-submit-btn .auth-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: authSpin .7s linear infinite;
  display: none;
}

.auth-submit-btn.loading .auth-spinner { display: inline-block; }
.auth-submit-btn.loading span:not(.auth-spinner) { opacity: .85; }

@keyframes authSpin { to { transform: rotate(360deg); } }

/* ===== SWITCH LOGIN/REGISTER TEXT ===== */
.auth-switch-text {
  text-align: center;
  font-size: .85rem;
  color: var(--gray-600);
  margin: 1.3rem 0 0;
}

.auth-switch-text a {
  font-weight: 700;
  color: var(--primary);
}

/* ===== REGISTER: ROLE TOGGLE (Pencari Kerja / Perusahaan) ===== */
.auth-role-toggle {
  display: flex;
  background: var(--gray-bg);
  border-radius: var(--radius-md);
  padding: .3rem;
  gap: .3rem;
  margin-bottom: 1.4rem;
}

.auth-role-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
  padding: .55rem .5rem;
  font-size: .82rem;
  font-weight: 700;
  color: var(--gray-600);
  cursor: pointer;
  transition: all .2s;
}

.auth-role-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ===== REGISTER: CHECKBOX ===== */
.auth-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin: .9rem 0 1.2rem;
}

.auth-checkbox-row input[type="checkbox"] {
  margin-top: .2rem;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}

.auth-checkbox-row label {
  font-size: .78rem;
  color: var(--gray-600);
  line-height: 1.5;
  cursor: pointer;
}

.auth-checkbox-row label a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

/* ===== TOAST ===== */
.auth-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--navy);
  color: #fff;
  padding: .85rem 1.3rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: .88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .6rem;
  z-index: 2000;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
}

.auth-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.auth-toast i { color: var(--green); font-size: 1.05rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 575.98px) {
  .auth-modal-body { padding: 2.2rem 1.4rem 1.6rem; }
  .auth-toast { left: 16px; right: 16px; bottom: 16px; }
}

body {
  background: #F8FAFC;
  min-height: 100vh;
}

/* ===== TOP BAR ===== */
.login-topbar {
  background: #fff;
  border-bottom: 1px solid var(--gray-border);
}

.login-topbar-text {
  font-size: .85rem;
  color: var(--gray-600);
  font-weight: 500;
}

/* ===== PAGE CONTAINER ===== */
.login-page-container {
  padding-top: 2rem;
  /* padding-bottom: 3.5rem; */
}

/* ===== SPLIT CARD ===== */
.login-split-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-border);
  overflow: hidden;
  min-height: 600px;
}

/* ===== PANEL KIRI: ILUSTRASI ===== */
.login-illust-panel {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%);
  position: relative;
  overflow: hidden;
  padding: 2.8rem 2.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
}

.login-illust-panel::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
  right: -90px;
  top: -110px;
}

.login-illust-panel::after {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
  left: -70px;
  bottom: -60px;
}

.login-illust-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .25);
  font-size: .76rem;
  font-weight: 700;
  padding: .35rem .75rem;
  border-radius: 20px;
  margin-bottom: 1.2rem;
  position: relative;
  z-index: 1;
}

.login-illust-title {
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: -.3px;
  margin-bottom: .7rem;
  position: relative;
  z-index: 1;
}

.login-illust-text {
  font-size: .92rem;
  color: rgba(255, 255, 255, .88);
  line-height: 1.6;
  max-width: 380px;
  position: relative;
  z-index: 1;
}

.login-illust-img {
  width: 100%;
  max-width: 290px;
  margin: 1rem auto;
  display: block;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .15));
}

.login-stats-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, .2);
  position: relative;
  z-index: 1;
}

.login-stat-item {
  display: flex;
  flex-direction: column;
}

.login-stat-item strong {
  font-size: 1.15rem;
  font-weight: 800;
}

.login-stat-item span {
  font-size: .74rem;
  color: rgba(255, 255, 255, .8);
  margin-top: .15rem;
}

/* ===== PANEL KANAN: FORM ===== */
.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.8rem 2.6rem;
}

.login-form-inner {
  width: 100%;
  max-width: 360px;
}

.login-form-title {
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--navy);
  letter-spacing: -.3px;
  margin-bottom: .4rem;
}

.login-form-subtitle {
  color: var(--gray-600);
  font-size: .88rem;
  margin-bottom: 1.7rem;
}

/* ===== REMEMBER ME ===== */
.login-remember-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: -.2rem 0 1.1rem;
}

.login-remember-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.login-remember-row label {
  font-size: .84rem;
  color: var(--gray-600);
  cursor: pointer;
}

/* ===== HELP BOX ===== */
.login-help-box {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--gray-bg);
  border-radius: var(--radius-md);
  padding: .8rem 1rem;
  margin-top: 1.6rem;
  font-size: .8rem;
  color: var(--gray-600);
}

.login-help-box i { color: var(--primary); font-size: 1.05rem; flex-shrink: 0; }

.login-help-box a {
  font-weight: 700;
  color: var(--primary);
}

/* ===== FLASH ALERT (sukses / error dari server) ===== */
.auth-flash {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  border-radius: var(--radius-md);
  padding: .75rem .9rem;
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 1.2rem;
  border: 1px solid transparent;
}
 
.auth-flash > i:first-child {
  font-size: 1.05rem;
  flex-shrink: 0;
  margin-top: .1rem;
}
 
.auth-flash span {
  flex-grow: 1;
}
 
.auth-flash-success {
  background: var(--green-bg);
  border-color: #BBF7D0;
  color: #15803D;
}
 
.auth-flash-success > i:first-child { color: var(--green); }
 
.auth-flash-error {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #B91C1C;
}
 
.auth-flash-error > i:first-child { color: #DC2626; }
 
.auth-flash-close {
  background: none;
  border: none;
  color: inherit;
  opacity: .55;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  cursor: pointer;
  transition: opacity .2s;
}
 
.auth-flash-close:hover { opacity: 1; }
 
/* ===== HELP BOX ===== */
.login-help-box {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--gray-bg);
  border-radius: var(--radius-md);
  padding: .8rem 1rem;
  margin-top: 1.6rem;
  font-size: .8rem;
  color: var(--gray-600);
}
 
.login-help-box i { color: var(--primary); font-size: 1.05rem; flex-shrink: 0; }
 
.login-help-box a {
  font-weight: 700;
  color: var(--primary);
}

/* ===== OTP DIGIT INPUTS ===== */
.otp-input-row {
  display: flex;
  gap: .7rem;
}

.otp-digit-input {
  width: 100%;
  aspect-ratio: 1 / 1;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
  border: 1.5px solid var(--gray-border);
  border-radius: var(--radius-md);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}

.otp-digit-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

#resendOtpCountdown {
  color: var(--gray-600);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
  .login-split-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .login-illust-panel {
    display: none;
  }

  .login-form-panel {
    padding: 2.2rem 1.6rem;
  }
}

@media (max-width: 575.98px) {
  .login-page-container { padding-top: 1.5rem; padding-bottom: 2rem; }
  .login-form-panel { padding: 1.8rem 1.2rem; }
  .login-form-inner { max-width: 100%; }
}