/* === Tombol Login & Register === */
.custom-login-btn,
.custom-register-btn,
.user-toggle {
  color: #fff;
  padding: 8px 16px;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  margin-left: 0px;
  cursor: pointer;
  font-weight: 500;
}

.custom-login-btn {
  background-color: #0C6EEB;
}

.custom-register-btn {
  background-color: #0756ba;
}

.user-toggle {
  background-color: #0C6EEB;
}

/* === Popup Umum === */
.custom-popup {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.popup-inner {
  background: #fff;
  padding: 25px;
  width: 90%;
  max-width: 400px;
  position: relative;
  border-radius: 8px;
}

.popup-inner h3 {
  margin-bottom: 20px;
  font-size: 20px;
}

.popup-inner input,
.popup-inner select {
  display: block;
  width: 100%;
  padding: 10px;
  font-size: 14px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.popup-inner label {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    position: relative;
    line-height: 14px;
    margin-top: 15px;
}

.custom-popup input[type="checkbox"] {
    float: none !important;
    position: static !important;
    margin: 0 !important;
    width: auto;
    display: inline-block;
}

.popup-inner button {
  width: 100%;
  padding: 12px;
  background: #0C6EEB;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.popup-inner .link-wrap {
  margin-top: 15px;
  text-align: right;
}

.popup-inner .link-wrap a {
  font-size: 13px;
  color: #0756ba;
  text-decoration: none;
}

.popup-inner .link-wrap a:hover {
  text-decoration: underline;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 20px;
  cursor: pointer;
  color: #333;
}

/* === Dropdown User === */
.custom-user-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 90%;
  right: 0;
  background: #fff;
  padding: 10px;
  min-width: 200px;
  display: none;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 9999;
}

.dropdown-menu a {
  display: block;
  padding: 10px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
}

.dropdown-menu a:hover {
  background: #f4f4f4;
}

.user-toggle:hover + .dropdown-menu,
.dropdown-menu:hover {
  display: block;
}

.form-error-message {
  display: none; /* pastikan disembunyikan awalnya */
  font-size: 13px;
  padding: 8px 10px;
  background: #fdecea;
  border: 1px solid #e74c3c;
  color: #e74c3c;
  border-radius: 4px;
  margin-bottom: 10px;
}


/* === Mobile Responsive === */
@media (max-width: 768px) {
  .custom-login-btn,
  .custom-register-btn,
  .user-toggle {
    font-size: 12px;
    padding: 6px 12px;
  }
  
  .custom-popup {
  z-index: 99999 !important;
}

.popup-inner {
  position: relative;
  z-index: 100000 !important;
}

.popup-inner button {
  pointer-events: auto !important;
}

  .popup-inner {
    width: 95%;
    padding: 20px;
  }

 .dropdown-menu {
  display: none !important;
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  width: 80%;
  background: #fff;
  padding-top: 60px;
  flex-direction: column;
  z-index: 999; /* HARUS lebih rendah dari popup */
  pointer-events: none; /* TAMBAHKAN agar tidak blok elemen lain saat hidden */
  opacity: 0;
  transition: all 0.2s ease;
}

.dropdown-menu.active {
  display: flex !important;
  opacity: 1;
  pointer-events: auto;
}

  .dropdown-menu.active {
    display: flex;
  }
}

/* ====== LOADING SPINNER ====== */
.btn-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-top: 3px solid #2980ff;
  border-radius: 50%;
  animation: btn-spin 0.9s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
  position: relative;
  top: 2px;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

