/* ==========================================================================
   MAGER WORKSPACE - MODERN MINIMAL GLASS LOGIN THEME
   Palette:
   - Background Light: #F4F5F3 (Warm White / Soft Gray)
   - Charcoal Primary: #202322
   - Secondary Gray:   #707571
   - Divider Line:     #E2E5E1
   - Glass Border:     rgba(255, 255, 255, 0.85)
   ========================================================================== */

#login-overlay {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  display: flex;
  flex-direction: row !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  background: #F4F5F3 !important;
  color: #202322 !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

html.rn-session-active #login-overlay,
#login-overlay.mager-hidden,
#login-overlay.mager-overlay-fadeout,
#login-overlay[style*="display: none"],
#login-overlay[style*="display:none"] {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ==========================================================================
   KOLOM KIRI: LOGO, LIQUID GLASS & FORM LOGIN (50%)
   ========================================================================== */
.mager-login-left {
  flex: 0 0 50%;
  width: 50%;
  height: 100%;
  position: relative;
  background-color: #F4F5F3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
  padding: 32px 24px;
}

/* 1. Logo MAGER di sudut kiri atas (24-32px dari tepi) */
.mager-login-logo-box {
  position: absolute;
  top: 24px;
  left: 28px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}

.mager-login-logo-img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}

/* 2. Liquid Glass Background (Abstract Curved Plates) */
.mager-liquid-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}

/* Luminous Liquid Color Orbs (Live Fluid Physics Driven) */
.mager-liquid-orb {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  will-change: transform;
  filter: blur(44px);
  opacity: 0.85;
  pointer-events: none;
}

/* Orb 1: Magenta / Rose Quartz (MAGER Brand Accent) */
.mager-liquid-orb-magenta {
  width: 460px;
  height: 460px;
  background: radial-gradient(circle at 40% 40%, rgba(244, 63, 94, 0.9) 0%, rgba(225, 29, 72, 0.6) 42%, rgba(190, 24, 93, 0.18) 68%, transparent 74%);
}

/* Orb 2: Electric Cyan / Ice Blue */
.mager-liquid-orb-cyan {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle at 45% 45%, rgba(56, 189, 248, 0.9) 0%, rgba(14, 165, 233, 0.6) 42%, rgba(99, 102, 241, 0.18) 68%, transparent 74%);
}

/* Orb 3: Warm Amber Sunlight */
.mager-liquid-orb-amber {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle at 38% 38%, rgba(251, 191, 36, 0.88) 0%, rgba(245, 158, 11, 0.58) 42%, rgba(217, 119, 6, 0.18) 68%, transparent 74%);
}

/* Orb 4: Emerald Mint Sage */
.mager-liquid-orb-mint {
  width: 440px;
  height: 440px;
  background: radial-gradient(circle at 40% 40%, rgba(52, 211, 153, 0.88) 0%, rgba(16, 185, 129, 0.58) 42%, rgba(5, 150, 105, 0.18) 68%, transparent 74%);
}

/* Orb 5: Royal Purple / Lavender */
.mager-liquid-orb-purple {
  width: 430px;
  height: 430px;
  background: radial-gradient(circle at 42% 42%, rgba(168, 85, 247, 0.88) 0%, rgba(126, 34, 206, 0.58) 42%, rgba(107, 33, 168, 0.18) 68%, transparent 74%);
}

/* Orb 6: Coral Rose / Sunset */
.mager-liquid-orb-rose {
  width: 390px;
  height: 390px;
  background: radial-gradient(circle at 38% 38%, rgba(251, 113, 133, 0.88) 0%, rgba(244, 63, 94, 0.58) 42%, rgba(225, 29, 72, 0.18) 68%, transparent 74%);
}

/* Frosted Curved Glass Lenses - Disabled to eliminate glitching */
.mager-glass-lens {
  display: none !important;
}

/* ==========================================================================
   AUTHENTIC iOS / APPLE VISIONOS FROSTED GLASS CARD
   ========================================================================== */
.mager-login-card {
  position: relative;
  z-index: 20;
  width: 360px;
  max-width: calc(100% - 48px);
  margin-top: -20px;
  padding: 34px 32px 30px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.45) 50%, rgba(255, 255, 255, 0.65) 100%);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1.2px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  box-shadow: 
    0 24px 60px -15px rgba(20, 24, 22, 0.12),
    0 4px 16px -2px rgba(20, 24, 22, 0.04),
    inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 1px 0 rgba(255, 255, 255, 0.25);
  box-sizing: border-box;
  overflow: hidden;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.mager-login-card:hover {
  box-shadow: 
    0 30px 70px -12px rgba(20, 24, 22, 0.15),
    0 6px 20px -2px rgba(20, 24, 22, 0.05),
    inset 0 1.5px 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 1px 0 rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.98);
}

/* Subtle Soft Glass Glare */
.mager-card-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle 380px at 15% 0%, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.08) 50%, transparent 80%);
  opacity: 0.6;
  mix-blend-mode: overlay;
  z-index: 1;
}

.mager-login-header {
  position: relative;
  z-index: 2;
  margin-bottom: 22px;
  text-align: left;
}

.mager-login-title {
  font-size: 21px;
  font-weight: 700;
  color: #202322;
  letter-spacing: -0.02em;
  margin: 0 0 6px 0;
  line-height: 1.25;
}

.mager-login-subtitle {
  font-size: 13px;
  color: #707571;
  margin: 0;
  line-height: 1.45;
  font-weight: 400;
}

/* Input Fields */
.mager-input-group {
  position: relative;
  z-index: 2;
  margin-bottom: 16px;
  text-align: left;
}

.mager-input-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #202322;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.mager-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.mager-input-field {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-size: 13.5px;
  font-family: inherit;
  color: #202322;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 229, 225, 0.85);
  border-radius: 11px;
  outline: none;
  box-sizing: border-box;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.mager-input-field::placeholder {
  color: #949a95;
  font-weight: 400;
}

.mager-input-field:focus {
  background: rgba(255, 255, 255, 0.95);
  border-color: #202322;
  box-shadow: 0 0 0 3px rgba(32, 35, 34, 0.12), inset 0 1px 1px rgba(0,0,0,0.02);
}

/* Password Toggle Visibility Button */
.mager-pwd-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #707571;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.mager-pwd-toggle:hover {
  color: #202322;
  background: rgba(32, 35, 34, 0.05);
}

/* Tombol Login Utama (Charcoal #202322) */
.mager-btn-submit {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 48px;
  margin-top: 8px;
  background: #202322;
  color: #FFFFFF;
  border: none;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(32, 35, 34, 0.15);
}

.mager-btn-submit:hover:not(:disabled) {
  background: #2f3432;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(32, 35, 34, 0.22);
}

.mager-btn-submit:active:not(:disabled) {
  transform: translateY(0);
  background: #181a19;
}

.mager-btn-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(32, 35, 34, 0.35);
}

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

/* Pesan Error Login */
.mager-error-box {
  margin-top: 14px;
  padding: 9px 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 9px;
  color: #dc2626;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  display: none;
  animation: magerFadeIn 0.25s ease;
}

@keyframes magerFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Loading Spinner */
.mager-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: magerSpin 0.7s linear infinite;
  display: inline-block;
}

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

/* Footer / Keterangan Halus Bawah Kartu */
.mager-login-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 11.5px;
  color: #707571;
}

.mager-login-footer span {
  font-weight: 600;
  color: #202322;
}

/* ==========================================================================
   KOLOM KANAN: SUSUNAN JENDELA ARSITEKTURAL (50%)
   Terdiri dari:
   - Panel Atas (50% tinggi): Foto Utama Statis + Jam Digital
   - Panel Bawah (50% tinggi):
     - Kiri: Slideshow 5 Gambar (Horizontal Slide)
     - Kanan: Rangkaian 3 Gambar (Crossfade Opasitas)
   ========================================================================== */
.mager-login-right {
  flex: 0 0 50%;
  width: 50%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  background: #121413;
  border-left: 1px solid #E2E5E1;
  overflow: hidden;
  box-sizing: border-box;
}

/* 1. Panel Atas: Foto Utama Statis (50% Tinggi) */
.mager-panel-top {
  position: relative;
  flex: 0 0 50%;
  height: 50%;
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid rgba(226, 229, 225, 0.4);
  background: #181b19;
}

.mager-panel-top-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: saturate(0.95) contrast(1.02);
}

.mager-panel-top-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(14, 17, 15, 0.58) 0%, rgba(14, 17, 15, 0.25) 55%, rgba(14, 17, 15, 0.38) 100%);
  pointer-events: none;
  z-index: 5;
}

/* Jam Digital & Tanggal di Sudut Kiri Atas Foto Utama (24-32px dari tepi) */
.mager-clock-widget {
  position: absolute;
  top: 28px;
  left: 32px;
  z-index: 10;
  background: rgba(18, 22, 20, 0.46);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 12px 18px 11px;
  color: #FFFFFF;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  user-select: none;
}

.mager-clock-time {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #FFFFFF;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.mager-clock-date {
  font-size: 12.5px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 5px;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

/* 2. Baris Panel Bawah (50% Tinggi Sisa) */
.mager-panel-bottom-row {
  position: relative;
  flex: 0 0 50%;
  height: 50%;
  width: 100%;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  box-sizing: border-box;
}

/* Panel Bawah Kiri: Slideshow 5 Gambar */
.mager-panel-slideshow {
  position: relative;
  flex: 0 0 50%;
  width: 50%;
  height: 100%;
  overflow: hidden;
  border-right: 1px solid rgba(226, 229, 225, 0.4);
  background: #141715;
}

.mager-slideshow-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

.mager-slide-item {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.mager-slide-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: saturate(0.96);
}

.mager-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(18, 22, 20, 0.1) 0%, rgba(18, 22, 20, 0.4) 100%);
  pointer-events: none;
}

/* Indikator Slideshow (5 buah: aktif = garis pendek, nonaktif = titik tipis) */
.mager-slideshow-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(18, 22, 20, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mager-slide-dot {
  width: 6px;
  height: 3.5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.35s ease;
}

.mager-slide-dot.active {
  width: 22px;
  background: #FFFFFF;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Navigasi Manual Slideshow (Panah Halus saat Hover) */
.mager-slide-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(18, 22, 20, 0.4);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s ease, background 0.2s ease;
}

.mager-panel-slideshow:hover .mager-slide-nav-btn {
  opacity: 0.85;
}

.mager-slide-nav-btn:hover {
  background: rgba(18, 22, 20, 0.7);
  opacity: 1 !important;
}

.mager-slide-nav-prev { left: 10px; }
.mager-slide-nav-next { right: 10px; }

/* Panel Bawah Kanan: Rangkaian 3 Gambar (Crossfade Opasitas) */
.mager-panel-crossfade {
  position: relative;
  flex: 0 0 50%;
  width: 50%;
  height: 100%;
  overflow: hidden;
  background: #141715;
}

.mager-crossfade-stage {
  position: relative;
  width: 100%;
  height: 100%;
}

.mager-crossfade-item {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  will-change: opacity;
}

.mager-crossfade-item.active {
  opacity: 1;
}

.mager-crossfade-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: saturate(0.95);
}

.mager-crossfade-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(18, 22, 20, 0.1) 0%, rgba(18, 22, 20, 0.4) 100%);
  pointer-events: none;
}

/* Badge Arsitektural Minimalis di Panel Bawah */
.mager-panel-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(18, 22, 20, 0.35);
  backdrop-filter: blur(6px);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ==========================================================================
   RESPONSIVITAS & AKSESIBILITAS
   ========================================================================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
  .mager-login-left {
    flex: 0 0 48%;
    width: 48%;
    padding: 24px 20px;
  }
  .mager-login-right {
    flex: 0 0 52%;
    width: 52%;
  }
  .mager-login-card {
    width: 340px;
    padding: 28px 24px;
  }
  .mager-clock-time {
    font-size: 26px;
  }
}

/* Layar Ponsel & Layar Kecil (< 768px) */
@media (max-width: 768px) {
  #login-overlay {
    flex-direction: column !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    height: 100% !important;
    min-height: 100vh !important;
  }

  .mager-login-left {
    flex: none;
    width: 100%;
    min-height: auto;
    padding: 76px 20px 36px;
    justify-content: flex-start;
  }

  .mager-login-logo-box {
    top: 20px;
    left: 20px;
  }

  .mager-login-logo-img {
    width: 74px;
    height: 74px;
  }

  .mager-login-card {
    width: 100%;
    max-width: 360px;
    margin-top: 0;
    padding: 26px 20px;
  }

  .mager-login-right {
    flex: none;
    width: 100%;
    height: 520px;
    border-left: none;
    border-top: 1px solid #E2E5E1;
  }

  .mager-panel-top {
    height: 280px;
    flex: none;
  }

  .mager-panel-bottom-row {
    height: 240px;
    flex: none;
  }

  .mager-clock-widget {
    top: 16px;
    left: 16px;
    padding: 10px 14px;
  }

  .mager-clock-time {
    font-size: 24px;
  }

  .mager-clock-date {
    font-size: 11.5px;
  }
}

/* Pengurangan Gerakan (Prefers Reduced Motion) */
@media (prefers-reduced-motion: reduce) {
  .mager-glass-shape {
    transition: none !important;
    transform: none !important;
  }
  .mager-slideshow-track {
    transition: none !important;
  }
  .mager-crossfade-item {
    transition: none !important;
  }
  #login-overlay {
    transition: none !important;
  }
}
