/* ============================================================
   OPERA — LOGIN PAGE STYLESHEET
   Full Screen Split Layout (Kiri Biru Siluet Pabrik PIM & Kanan Putih)
   Clean, modern, responsive, and elegant.
   ============================================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-focus: #2563eb;
  --white: #ffffff;
  --danger: #ef4444;
  --warn: #f59e0b;
  --radius-md: 0.65rem;
  --transition: all 0.2s ease;
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

@media (min-width: 1101px) {
  html {
    font-size: 17.6px;
  }
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: "Plus Jakarta Sans", sans-serif;
  background-color: var(--white);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

.display-font {
  font-family: "Raleway", sans-serif;
}

/* Background blobs dimatikan untuk tampilan full split screen bersih */
.bg-blob {
  display: none !important;
}

/* ---- Fullscreen Split Container ---- */
.login-wrapper {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  background: var(--white);
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

/* ============================================================
   PANEL KIRI (55%) — BIRU ELEGAN DENGAN SILUET PABRIK PIM
   ============================================================ */
.login-visual {
  flex: 1.15;
  width: 55%;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3.75rem 4.5rem;
  color: #ffffff;
  overflow: hidden;
  /* Background Foto Pabrik PT Pupuk Iskandar Muda dibuat jauh lebih jelas dan tampak nyata */
  background: 
    linear-gradient(135deg, rgba(20, 60, 165, 0.48) 0%, rgba(12, 35, 110, 0.58) 50%, rgba(6, 18, 65, 0.72) 100%),
    url("../../img/bg_pim.jpeg") center center / cover no-repeat;
}

/* Atmospheric Subtle Vignette (tidak menutupi detail pabrik) */
.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.15) 0%, transparent 60%),
    linear-gradient(to bottom, rgba(10, 25, 70, 0.10) 0%, rgba(5, 14, 45, 0.40) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Tech Dot Grid Texture Sangat Halus */
.login-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.10) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 2;
  opacity: 0.22;
}

.visual-inner {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Brand Header */
.visual-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.visual-logo .logo-img {
  height: 48px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
  opacity: 1;
}

.visual-company-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(8, 20, 60, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50rem;
  padding: 0.32rem 0.95rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: #ffffff;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.2px;
}

/* Hero Center Content */
.visual-hero {
  padding: 2.5rem 0;
}

.visual-heading {
  font-size: 2.30rem;
  font-weight: 800;
  line-height: 1.25;
  color: #ffffff;
  margin-bottom: 1.25rem;
  letter-spacing: -0.3px;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.75), 0 1px 3px rgba(0, 0, 0, 0.9);
}

.visual-heading .highlight {
  color: #93c5fd;
  font-weight: 800;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.75), 0 1px 3px rgba(0, 0, 0, 0.9);
}

.visual-desc {
  font-size: 1.02rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.7;
  max-width: 530px;
  margin-bottom: 2rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

/* Feature Pills */
.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(8, 20, 60, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  border-radius: 50rem;
  padding: 0.42rem 1.05rem;
  font-size: 0.80rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  transition: var(--transition);
}

.pill:hover {
  background: rgba(20, 45, 115, 0.75);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}

.pill i {
  color: #93c5fd;
}

/* Visual Footer */
.visual-footer {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.visual-company-name {
  font-weight: 600;
  color: #ffffff;
}

/* ============================================================
   PANEL KANAN (45%) — PUTIH BERSIH DENGAN FORM LOGIN
   ============================================================ */
.login-form-panel {
  flex: 1;
  width: 45%;
  min-height: 100vh;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 4rem;
  position: relative;
}

.form-inner {
  width: 100%;
  max-width: 420px;
}

/* Form Header */
.form-header {
  margin-bottom: 2rem;
}

.form-header h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  letter-spacing: -0.3px;
}

.form-header p {
  color: var(--text-muted);
  font-size: 0.90rem;
  margin: 0;
  line-height: 1.5;
}

/* Custom Alerts */
.alert-custom {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 500;
  margin-bottom: 1.35rem;
  line-height: 1.45;
}

.alert-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.alert-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

/* Form Fields */
.field-wrap {
  margin-bottom: 1.25rem;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.5rem;
  letter-spacing: 0.15px;
}

.field-label i {
  color: var(--primary);
  font-size: 0.95rem;
}

.field-input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0.72rem 1.15rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-main);
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: var(--transition);
  -webkit-appearance: none;
}

.field-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.field-input:focus {
  background: var(--white);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.14);
}

.field-input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

/* Password field wrapper */
.password-wrap {
  position: relative;
}

.password-wrap .field-input {
  padding-right: 3rem;
}

.pwd-toggle {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.35rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  font-size: 1.1rem;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwd-toggle:hover {
  color: var(--primary);
}

.field-hint {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.invalid-msg {
  color: var(--danger);
}

/* Submit button */
.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 50px;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: var(--white);
  font-family: "Raleway", sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  border: none;
  border-radius: 50rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  letter-spacing: 0.3px;
  margin-top: 1.5rem;
  position: relative;
  overflow: hidden;
}

.btn-login:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.btn-login:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-login:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

.btn-loading {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* Security footnote */
.security-note {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.74rem;
  color: #94a3b8;
  font-weight: 500;
  line-height: 1.55;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.security-note i {
  color: #64748b;
  font-size: 0.85rem;
}

/* ============================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ============================================================ */
@media (max-width: 991.98px) {
  .login-wrapper {
    flex-direction: column;
    min-height: 100vh;
    height: auto;
  }

  .login-visual {
    width: 100%;
    flex: none;
    min-height: auto;
    padding: 1.5rem 1.75rem 1.25rem;
  }

  .visual-header {
    margin-bottom: 0.75rem;
  }

  .visual-logo .logo-img {
    height: 36px;
  }

  .visual-hero {
    padding: 0;
  }

  .visual-heading {
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
    line-height: 1.3;
  }

  .visual-desc {
    display: none;
  }

  .feature-pills {
    display: none;
  }

  .visual-footer {
    display: none;
  }

  .login-form-panel {
    width: 100%;
    flex: 1;
    min-height: auto; /* Reset 100vh agar form naik pas di tengah sisa layar tanpa celah kosong */
    padding: 1.75rem 2rem 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .form-inner {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
  }

  .form-header {
    margin-bottom: 1.25rem;
  }

  .form-header h2 {
    font-size: 1.55rem;
    margin-bottom: 0.25rem;
  }

  .form-header p {
    font-size: 0.85rem;
  }

  .field-wrap {
    margin-bottom: 1rem;
  }

  .field-input {
    height: 46px;
    font-size: 0.90rem;
  }

  .btn-login {
    height: 48px;
    margin-top: 1.25rem;
    font-size: 0.95rem;
  }

  .security-note {
    margin-top: 1.25rem;
    font-size: 0.72rem;
  }
}

@media (max-width: 575.98px) {
  .login-visual {
    padding: 1.25rem 1.25rem 1rem;
  }

  .visual-header {
    margin-bottom: 0.5rem;
  }

  .visual-logo .logo-img {
    height: 32px;
  }

  .visual-company-tag {
    font-size: 0.68rem;
    padding: 0.2rem 0.65rem;
  }

  .visual-heading {
    font-size: 1.15rem;
    margin-bottom: 0;
  }

  .login-form-panel {
    padding: 1.25rem 1.25rem 1.75rem;
  }

  .form-header {
    margin-bottom: 1.15rem;
  }

  .form-header h2 {
    font-size: 1.45rem;
    margin-bottom: 0.2rem;
  }

  .form-header p {
    font-size: 0.82rem;
  }

  .field-wrap {
    margin-bottom: 0.9rem;
  }

  .field-label {
    font-size: 0.78rem;
    margin-bottom: 0.35rem;
  }

  .field-input {
    height: 44px;
    font-size: 0.86rem;
  }

  .btn-login {
    height: 46px;
    margin-top: 1.15rem;
    font-size: 0.92rem;
  }

  .security-note {
    margin-top: 1rem;
    font-size: 0.70rem;
  }
}

/* ============================================================
   MFA GOOGLE AUTHENTICATOR SPECIFIC STYLES (MATCHING LOGIN SCALE)
   ============================================================ */
.mfa-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 50rem;
  padding: 0.28rem 0.75rem;
  font-size: 0.78rem;
  color: #334155;
  margin-bottom: 1.15rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.mfa-user-pill .badge-num {
  font-weight: 700;
  color: var(--primary);
  font-family: monospace;
}

.mfa-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.otp-input-field {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.45rem;
  letter-spacing: 0.45rem;
  text-align: center;
  height: 48px;
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background-color: #f8fafc;
  color: var(--text-main);
  font-weight: 700;
  transition: var(--transition);
  width: 100%;
  display: block;
}

.otp-input-field:focus {
  background-color: var(--white);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  outline: none;
}

.otp-input-field::placeholder {
  color: #94a3b8;
  letter-spacing: 0.35rem;
  font-size: 1.15rem;
}

.btn-cancel-mfa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  height: 40px;
  margin-top: 0.65rem;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 50rem;
  text-decoration: none !important;
  transition: var(--transition);
}

.btn-cancel-mfa:hover {
  background: #f1f5f9;
  color: var(--text-main);
  border-color: #cbd5e1;
}

/* Setup QR & Manual Key Box */
.qr-card-wrap {
  background: #ffffff;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

#qrcode {
  padding: 4px;
  background: #ffffff;
  border-radius: 6px;
  line-height: 0;
}

#qrcode img {
  margin: 0 auto;
  border-radius: 4px;
  width: 130px !important;
  height: 130px !important;
}

.secret-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.35rem 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  width: 100%;
  margin-top: 0.55rem;
}

.secret-code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12rem;
  color: var(--text-main);
  word-break: break-all;
}

.btn-copy {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  padding: 0.2rem 0.45rem;
  font-size: 0.70rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-copy:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.mfa-step-tag {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.76rem;
  color: #475569;
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

.mfa-step-tag ol {
  margin: 0;
  padding-left: 1.15rem;
}

.mfa-step-tag li {
  margin-bottom: 0.15rem;
}

.mfa-step-tag li:last-child {
  margin-bottom: 0;
}
