/* Popup Overlay */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.popup-overlay.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Popup Container */
.popup-container {
  position: relative;
  background: url(https://truyenvn.shop/wp-content/themes/madara/images/bg-search.jpg)
    center / cover;
  padding: 20px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Close Button */
.popup-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 35px;
  height: 35px;
  border: none;
  background: transparent;
  color: #999;
  font-size: 28px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.popup-close:hover {
  background: #e0e0e0;
  color: var(--primary-color);
  transform: rotate(90deg);
}

/* Form Header */
.popup-header {
  text-align: center;
  margin-bottom: 20px;
}

.popup-title {
  font-size: 26px;
  font-weight: 700;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: #666;
}

.form-label .required {
  color: var(--primary-color);
  margin-left: 3px;
}

.form-input {
  padding: 16px 20px;
  border: 2px solid #e0e0e0;
  border-radius: 30px;
  font-size: 15px;
  background: #fff;
  color: #333;
  transition: all 0.3s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

.form-input::placeholder {
  color: #bbb;
}

/* ===================== REMEMBER ME CHECKBOX STYLING ===================== */

/* Remember Me */
.form-remember {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: -10px;
}

.form-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-color);
  transition: transform 0.2s ease;
}

.form-checkbox:hover {
  transform: scale(1.1);
}

.form-checkbox:checked {
  transform: scale(1.15);
}

.form-remember label {
  font-size: 14px;
  color: #666;
  cursor: pointer;
  user-select: none;
  transition: color 0.3s ease;
}

.form-remember label:hover {
  color: var(--primary-color);
}

/* Submit Button */
.form-submit {
  padding: 16px;
  background: linear-gradient(135deg, var(--primary-color) 0%, #c2185b 100%);
  color: #fff;
  border: none;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 10px;
}

.form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(233, 30, 99, 0.3);
}

.form-submit:active {
  transform: translateY(0);
}

.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Form Footer */
.form-footer {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-footer a {
  color: #666;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
  cursor: pointer;
}

.form-footer a:hover {
  color: var(--primary-color);
}

/* Decorative Elements */
.popup-overlay::before,
.popup-overlay::after {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(233, 30, 99, 0.1);
  z-index: 0;
}

.popup-overlay::before {
  top: 10%;
  left: 10%;
}

.popup-overlay::after {
  bottom: 15%;
  right: 15%;
}

/* Additional styles for forget password popup */
.popup-subtitle {
  color: var(--primary-color);
  font-size: 12px;
  margin-top: 15px;
}

/* Responsive */
@media (max-width: 600px) {
  .popup-container {
    padding: 40px 30px;
    margin: 20px;
  }

  .popup-title {
    font-size: 26px;
  }

  .form-input {
    padding: 14px 18px;
  }
}

/* ===================== PASSWORD INPUT WITH EYE ICON - FIXED ===================== */

/* Wrapper chỉ chứa input + icon */
.password-input-wrapper {
  position: relative;
  width: 100%;
  height: 54px; /* CỐ ĐỊNH chiều cao input */
}

/* Input */
.password-input-wrapper .form-input {
  width: 100%;
  height: 100%;
  padding-right: 55px;
  box-sizing: border-box;
}

/* Icon mắt */
.toggle-password {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  color: #bbb;
  transition: 0.25s ease;
}

.toggle-password:hover {
  background: rgba(233, 30, 99, 0.08);
  color: var(--primary-color);
}

.toggle-password i {
  font-size: 18px;
  pointer-events: none;
}

/* Active state when password is visible */
.toggle-password.active {
  color: var(--primary-color);
  background: rgba(233, 30, 99, 0.1);
}

.toggle-password.active i {
  transform: scale(1.1);
}

.toggle-password:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.15);
}

/* Animation when toggling */
@keyframes iconToggle {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.toggle-password i.toggling {
  animation: iconToggle 0.3s ease;
}

/* ===================== FORM ERROR STYLING ===================== */

.form-error {
  margin-top: 6px;
  font-size: 13px;
  color: var(--primary-color);
  line-height: 1.4;
}

/* When error is shown - JavaScript will change display to block */
.form-error[style*="display: block"] {
  display: block !important;
}

/* Error border for input */
.form-input.error {
  border-color: #e74c3c !important;
}

/* ===================== RESPONSIVE ADJUSTMENTS ===================== */

@media (max-width: 600px) {
  .password-input-wrapper .form-input {
    padding-right: 50px;
  }

  .toggle-password {
    right: 12px;
    /* top và transform giữ nguyên để vẫn căn giữa */
    width: 34px;
    height: 34px;
  }

  .toggle-password i {
    font-size: 16px;
  }

  .form-error {
    font-size: 12px !important;
    padding-left: 6px !important;
  }
}

/* ===================== FORM MESSAGE STYLES ===================== */
.form-message {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
  animation: slideDown 0.3s ease;
}

.error-message {
  background-color: #fee;
  border: 1px solid #fcc;
  color: #c33;
}

.success-message {
  background-color: #efe;
  border: 1px solid #cfc;
  color: #3c3;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Disable state cho button */
.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #ccc;
}

/* ===================== PASSWORD STRENGTH INDICATOR ===================== */
.password-strength {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.strength-bar {
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  overflow: hidden;
  flex: 1;
}

.strength-bar-fill {
  height: 100%;
  width: 0%;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.strength-text {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.password-requirements {
  margin-top: 6px;
}

.password-requirements p {
  font-size: 11px;
  color: #666;
  margin: 0 0 4px 0;
  font-weight: 500;
}

.password-requirements ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.password-requirements li {
  transition: color 0.3s ease;
  font-size: 11px;
  line-height: 1.3;
}

.password-requirements li i {
  margin-right: 3px;
  font-size: 10px;
}
