/* ============================================================
   AUTH.CSS — Gaya Visual Terisolasi Khusus Modal Auth
   Ulik Arsip | assets/css/auth.css
   ============================================================ */

/* --- VARIABEL LOKAL (Hanya berlaku untuk lingkup Auth) --- */
#authModal, .auth-overlay {
  --auth-p-color: #1e362b;       /* Navy khas Ulik Arsip */
  --auth-p-hover: #70998A;
  --auth-accent: #e7a22b;        /* Oranye bata historis */
  --auth-bg: #ffffff;
  --auth-txt: #1e362b;
  --auth-muted: #1e362b;
  --auth-border-color: #e2e8f0;
  --auth-err-color: #e7a22b;
  --auth-succ-color: #70998A;
  --auth-f-serif: 'Bitter', serif;
  --auth-f-sans: 'Poppins', sans-serif;
}

/* --- OVERLAY BACKGROUND (BLUR) --- */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.auth-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* --- KONTAINER MODAL UTAMA --- */
.auth-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -45%) scale(0.95);
  width: 92%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  z-index: 99999;
  padding: 32px !important;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.auth-modal.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* --- TOMBOL SILANG CLOSE --- */
.auth-modal .auth-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #f8fafc;
  border: none !important;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--auth-muted);
  transition: all 0.2s ease;
  padding: 0;
}
.auth-modal .auth-modal-close:hover {
  background: #70998A;
  color: #fff;
  transform: rotate(90deg);
}

/* --- NAVIGASI TABS --- */
.auth-modal .auth-tabs {
  display: flex !important;
  border-bottom: 2px solid var(--auth-border-color) !important;
  margin-bottom: 24px !important;
  gap: 16px !important;
  background: transparent !important;
  padding: 0 !important;
}
.auth-modal .auth-tab {
  flex: 1;
  background: none !important;
  border: none !important;
  padding: 12px 0 !important;
  font-family: var(--auth-f-sans) !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: var(--auth-muted) !important;
  cursor: pointer;
  position: relative;
  text-align: center;
  box-shadow: none !important;
}
.auth-modal .auth-tab.active {
  color: var(--auth-p-color) !important;
}
.auth-modal .auth-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--auth-accent);
}

/* --- DISPLAY MANAGEMENT PANEL --- */
.auth-modal .auth-panel {
  display: none !important;
}
.auth-modal .auth-panel.active {
  display: block !important;
  animation: authFadeIn 0.2.5s ease;
}
@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- FORM GROUPS & ELEMEN INTERNAL --- */
.auth-modal .auth-form-group {
  margin-bottom: 16px !important;
  text-align: left !important;
}
.auth-modal .auth-form-group label {
  display: block !important;
  font-family: var(--auth-f-sans) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--auth-txt) !important;
  margin-bottom: 6px !important;
  float: none !important;
}
.auth-modal .auth-label-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 6px !important;
}
.auth-modal .auth-label-row label {
  margin-bottom: 0 !important;
}

/* --- WRAPPER INPUT DAN FIELD --- */
.auth-modal .auth-input-wrap {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
}
.auth-modal .auth-input-wrap input {
  width: 100% !important;
  padding: 11px 16px !important;
  font-family: var(--auth-f-sans) !important;
  font-size: 14px !important;
  border: 1.5px solid #70998A !important;
  border-radius: 8px !important;
  outline: none !important;
  transition: all 0.2s ease !important;
  background-color: #fdfdfd !important;
  color: #333333 !important;
  height: auto !important;
}
.auth-modal .auth-input-wrap input:focus {
  border-color: #70998A !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1) !important;
}
.auth-modal .auth-input-wrap input.input-error {
  border-color: var(--auth-err-color) !important;
  background-color: #fffaf9 !important;
}

/* --- BUTTON TOGGLE PASSWORD (MATA) --- */
.auth-modal .toggle-password {
  position: absolute !important;
  right: 14px !important;
  background: none !important;
  border: none !important;
  color: var(--auth-muted) !important;
  cursor: pointer !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 16px !important;
  box-shadow: none !important;
  width: auto !important;
  height: auto !important;
}

/* --- ERROR & BANNER NOTIFIKASI --- */
.auth-modal .auth-field-error {
  font-family: var(--auth-f-sans) !important;
  font-size: 12px !important;
  color: #1e362b !important;
  margin-top: 4px !important;
  display: none;
}
.auth-modal .auth-field-error.show {
  display: block !important;
}
.auth-modal .auth-alert {
  padding: 10px 14px !important;
  border-radius: 8px !important;
  font-family: var(--auth-f-sans) !important;
  font-size: 13px !important;
  margin-bottom: 16px !important;
  display: none;
  font-weight: 500 !important;
}
.auth-modal .auth-alert.show {
  display: block !important;
}
.auth-modal .auth-alert.error {
  background-color: #fdedec !important;
  color: var(--auth-err-color) !important;
  border: 1px solid #f5b7b1 !important;
}
.auth-modal .auth-alert.success {
  background-color: #e8f8f5 !important;
  color: var(--auth-succ-color) !important;
  border: 1px solid #a3e4d7 !important;
}

/* --- SUBMIT & GOOGLE BUTTONS --- */
.auth-modal .auth-submit-btn {
  width: 100% !important;
  padding: 12px !important;
  background: var(--auth-p-color) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px !important;
  font-family: var(--auth-f-sans) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  margin-top: 8px !important;
  box-shadow: none !important;
}
.auth-modal .auth-submit-btn:hover {
  background: var(--auth-p-hover) !important;
}

.auth-modal .auth-divider {
  display: flex !important;
  align-items: center !important;
  text-align: center !important;
  margin: 20px 0 !important;
  color: var(--auth-muted) !important;
  font-family: var(--auth-f-sans) !important;
  font-size: 13px !important;
}
.auth-modal .auth-divider::before,
.auth-modal .auth-divider::after {
  content: '' !important;
  flex: 1 !important;
  border-bottom: 1px solid var(--auth-border-color) !important;
}
.auth-modal .auth-divider:not(:empty)::before { margin-right: .75em !important; }
.auth-modal .auth-divider:not(:empty)::after { margin-left: .75em !important; }

.auth-modal .auth-btn-google {
  width: 100% !important;
  padding: 11px !important;
  background: #ffffff !important;
  border: 1.5px solid var(--auth-border-color) !important;
  border-radius: 8px !important;
  font-family: var(--auth-f-sans) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--auth-txt) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
}
.auth-modal .auth-btn-google i {
  color: #ea4335 !important;
}
.auth-modal .auth-btn-google:hover {
  background: #f8fafc !important;
}

/* --- LINUX/RESET STYLING --- */
.auth-modal .auth-link-btn {
  background: none !important;
  border: none !important;
  font-family: var(--auth-f-sans) !important;
  font-size: 13px !important;
  color: var(--auth-accent) !important;
  cursor: pointer !important;
  padding: 0 !important;
  font-weight: 500 !important;
}
.auth-modal .auth-link-btn:hover {
  text-decoration: underline !important;
}
.auth-modal .auth-reset-header h3 {
  font-family: var(--auth-f-serif) !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  color: var(--auth-p-color) !important;
  margin-bottom: 8px !important;
}
.auth-modal .auth-reset-header p {
  font-family: var(--auth-f-sans) !important;
  font-size: 13px !important;
  color: var(--auth-muted) !important;
}
.auth-modal .auth-back-btn {
  width: 100% !important;
  background: none !important;
  border: none !important;
  font-family: var(--auth-f-sans) !important;
  font-size: 14px !important;
  color: var(--auth-muted) !important;
  margin-top: 16px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
}

/* --- STRENGTH METER METER --- */
.auth-modal .password-strength {
  margin-top: 8px !important;
  display: none;
}
.auth-modal .password-strength.show {
  display: block !important;
}
.auth-modal .strength-bar {
  background: #e2e8f0 !important;
  height: 4px !important;
  border-radius: 2px !important;
  overflow: hidden !important;
  margin-bottom: 4px !important;
}
.auth-modal .strength-fill {
  height: 100% !important;
  width: 0;
  transition: all 0.3s ease !important;
}
.auth-modal .strength-text {
  font-family: var(--auth-f-sans) !important;
  font-size: 11px !important;
}

/* --- BREAKPOINT HP --- */
@media (max-width: 480px) {
  .auth-modal {
    padding: 24px 20px !important;
    width: 92% !important;
  }
}

/* ============================================================
   COMPONENT: USER PROFILE DROPDOWN (HEADER GLOBAL)
   ============================================================ */

/* Wrapper Utama Tombol Profil */
.auth-button .user-profile-wrapper {
  position: relative !important;
  display: inline-block;
  z-index: 999;
}

/* Tombol Pemicu Dropdown (Avatar + Nama) */
.auth-button .user-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.20);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 12px;
  cursor: pointer;
  color: #ffffff;
  font-family: var(--auth-f-sans);
  font-size: 11px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.auth-button .user-profile-btn:hover {
  background: #70998A;
  border-color: rgba(112,153,138,0.30);
}

/* Lingkaran Avatar Huruf */
.auth-button .user-avatar {
  width: 20px;
  height: 20px;
  background: #e7a22b;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
}

/* Kotak Dropdown Melayang Pop-Up */
.auth-button .user-dropdown {
  position: absolute !important;
  top: 100% !important;
  right: 0 !important;
  margin-top: 5px !important;
  width: 220px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid var(--auth-border-color);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  display: none; /* Dikontrol via JavaScript (.show) */
  z-index: 1000;
  padding: 5px 0; /* Menggunakan padding vertikal container */
  box-sizing: border-box;
}

/* Trigger Tampilan Via JS */
.auth-button .user-dropdown.show {
  display: block;
  animation: authFadeIn 0.25s ease;
}

/* Header Profil di Dalam Dropdown */
.auth-button .user-dropdown .dropdown-header {
  padding: 5px 15px;
  text-align: left;
}

.auth-button .user-dropdown .drop-name {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #1e362b;
  margin: 0px;
}

.auth-button .user-dropdown .drop-email {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  color: #788896;
  margin: 1px 0 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Garis Pembatas (HR) Internal Dropdown */
.auth-button .user-dropdown hr {
  margin: 2px 0;
  border: 0;
  border-top: 1px solid rgba(30, 54, 43, 0.3);
  opacity: 5;
}

/* ============================================================
   ELEMENTS: ITEM LINKS INSIDE USER DROPDOWN
   ============================================================ */

/* Aturan Umum untuk Semua Item/Tombol di Dalam Dropdown */
.auth-button .user-dropdown .dropdown-item-link,
.auth-button .user-dropdown .btn-logout-item {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 8px 15px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  background: none;
  border: none;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

/* Style Khusus Dashboard */
.auth-button .user-dropdown .dropdown-item-link {
  color: #1e362b;
}

/* Style Khusus Tombol Keluar (Logout) */
.auth-button .user-dropdown .btn-logout-item {
  color: #ea4335; /* Tetap merah standar logout universal */
}

/* Aturan Icon di Dalam Dropdown */
.auth-button .user-dropdown .dropdown-item-link i,
.auth-button .user-dropdown .btn-logout-item i {
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-button .user-dropdown .dropdown-item-link i {
  color: #1e362b;
}

/* Efek Hover Seragam & Presisi */
.auth-button .user-dropdown .dropdown-item-link:hover,
.auth-button .user-dropdown .btn-logout-item:hover {
  background-color: rgba(78, 132, 108, 0.3) !important;
  color: #1e362b !important;
}

/* Khusus hover tombol logout agar teksnya tetap merah tebal */
.auth-button .user-dropdown .btn-logout-item:hover {
  color: #c0392b !important;
}