/* FE Toast Notification Styles */
.fe-toast-container {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  max-width: 400px;
  width: 100%;
}

.fe-toast-container.fe-toast-top-right {
  top: 20px;
  right: 20px;
}

.fe-toast-container.fe-toast-top-left {
  top: 20px;
  left: 20px;
}

.fe-toast-container.fe-toast-bottom-right {
  bottom: 20px;
  right: 20px;
}

.fe-toast-container.fe-toast-bottom-left {
  bottom: 20px;
  left: 20px;
}

.fe-toast {
  pointer-events: auto;
  margin-bottom: 10px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease-in-out;
  max-width: 100%;
  word-wrap: break-word;
}

.fe-toast.fe-toast-visible {
  transform: translateX(0);
  opacity: 1;
}

.fe-toast.fe-toast-exiting {
  transform: translateX(100%);
  opacity: 0;
}

.fe-toast-content {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  background: #fff;
  border-left: 4px solid;
  position: relative;
}

.fe-toast-success .fe-toast-content {
  border-left-color: #10b981;
  background: #f0fdf4;
}

.fe-toast-error .fe-toast-content {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.fe-toast-warning .fe-toast-content {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.fe-toast-info .fe-toast-content {
  border-left-color: #3b82f6;
  background: #eff6ff;
}

.fe-toast-icon {
  margin-right: 12px;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.fe-toast-success .fe-toast-icon {
  color: #10b981;
}

.fe-toast-error .fe-toast-icon {
  color: #ef4444;
}

.fe-toast-warning .fe-toast-icon {
  color: #f59e0b;
}

.fe-toast-info .fe-toast-icon {
  color: #3b82f6;
}

.fe-toast-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  color: #374151;
  font-weight: 500;
}

.fe-toast-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.fe-toast-close:hover {
  color: #6b7280;
  background: rgba(0, 0, 0, 0.05);
}

/* Mobile responsive */
@media (max-width: 640px) {
  .fe-toast-container {
    left: 10px !important;
    right: 10px !important;
    max-width: none;
  }

  .fe-toast {
    margin-bottom: 8px;
  }

  .fe-toast-content {
    padding: 12px;
  }

  .fe-toast-message {
    font-size: 13px;
  }
}

/* Animation for left-positioned toasts */
.fe-toast-container.fe-toast-top-left .fe-toast,
.fe-toast-container.fe-toast-bottom-left .fe-toast {
  transform: translateX(-100%);
}

.fe-toast-container.fe-toast-top-left .fe-toast.fe-toast-visible,
.fe-toast-container.fe-toast-bottom-left .fe-toast.fe-toast-visible {
  transform: translateX(0);
}

.fe-toast-container.fe-toast-top-left .fe-toast.fe-toast-exiting,
.fe-toast-container.fe-toast-bottom-left .fe-toast.fe-toast-exiting {
  transform: translateX(-100%);
}

/* =============================================================================
   OTP Popup Styles
   ============================================================================= */

.canhcam-otp-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.canhcam-otp-popup {
  background: #fff;
  border-radius: 12px;
  padding: 32px 28px;
  max-width: 400px;
  width: 90%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: otpIn 0.3s ease;
}

@keyframes otpIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.otp-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: #999;
  padding: 0;
}

.otp-close:hover {
  color: #333;
}

.canhcam-otp-popup .otp-icon {
  text-align: center;
  margin-bottom: 14px;
}

.canhcam-otp-popup .otp-icon svg {
  width: 50px;
  height: 50px;
  fill: #007bff;
}

.canhcam-otp-popup h3 {
  text-align: center;
  margin-bottom: 6px;
  font-size: 19px;
}

.canhcam-otp-popup .otp-desc {
  text-align: center;
  color: #666;
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.5;
}

.canhcam-otp-popup .otp-email {
  font-weight: bold;
  color: #333;
}

.otp-digits {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 18px;
}

.otp-digits input {
  width: 44px;
  height: 50px;
  text-align: center;
  font-size: 22px;
  font-weight: bold;
  border: 2px solid #ddd;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
  appearance: textfield;
}

.otp-digits input::-webkit-outer-spin-button,
.otp-digits input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.otp-digits input:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.otp-digits input.ok {
  border-color: #28a745;
  background: #f0fff4;
}

.otp-digits input.err {
  border-color: #dc3545;
  background: #fff5f5;
  animation: shake 0.4s;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.canhcam-otp-popup .otp-submit {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: 8px;
}

.canhcam-otp-popup .otp-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.otp-acts {
  text-align: center;
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.otp-acts button {
  color: #007bff;
  font-size: 13px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.otp-acts button:hover {
  text-decoration: underline;
}

.otp-acts button:disabled {
  color: #999;
  cursor: not-allowed;
}

.otp-timer {
  text-align: center;
  color: #999;
  font-size: 13px;
  margin-top: 10px;
}

.otp-msg {
  text-align: center;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  display: none;
}

.otp-msg.success {
  background: #d4edda;
  color: #155724;
  display: block;
}

.otp-msg.error {
  background: #f8d7da;
  color: #721c24;
  display: block;
}

.otp-loading {
  display: none;
  text-align: center;
  margin: 8px 0;
}

.otp-loading.active {
  display: block;
}

.otp-spin {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  0% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Login error message */
.cc-lerr {
  margin-bottom: 15px;
  padding: 10px 15px;
  background: #f8d7da;
  color: #721c24;
  border-radius: 6px;
  font-size: 14px;
}
