﻿/* Tech-ME portal alerts and toasts */

.portal-alert,
.login-alert.portal-alert,
.portal-content .portal-alert {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  width: min(92vw, 520px);
  margin: 0;
  padding: 0.9rem 1rem 0.9rem 3rem;
  border-radius: 12px;
  border: 1px solid transparent;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  z-index: 11000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.portal-alert.is-visible,
.login-alert.portal-alert.is-visible,
.portal-content .portal-alert.is-visible,
.portal-alert.portal-alert--warning[style*="display: block"],
.portal-alert.portal-alert--warning[style*="display:block"],
.portal-alert.portal-alert--success[style*="display: block"],
.portal-alert.portal-alert--success[style*="display:block"],
.portal-alert.portal-alert--info[style*="display: block"],
.portal-alert.portal-alert--info[style*="display:block"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.portal-alert::before {
  content: "\f05a";
  font-family: FontAwesome;
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
}

.portal-alert--success {
  background: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
  border-color: rgba(255, 255, 255, 0.15);
}

.portal-alert--success::before {
  content: "\f00c";
}

.portal-alert--info {
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
  border-color: rgba(255, 255, 255, 0.15);
}

.portal-alert--warning,
.portal-alert--error {
  background: linear-gradient(135deg, #c2410c 0%, #f97316 100%);
  border-color: rgba(255, 255, 255, 0.15);
}

.portal-alert--warning::before,
.portal-alert--error::before {
  content: "\f071";
}

.portal-alert__close {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.portal-alert__close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.portal-alert__message {
  display: block;
  padding-right: 1.75rem;
}

.portal-alert--persist,
.portal-alert--no-close {
  width: min(94vw, 640px);
  padding-bottom: 1rem;
}

.portal-alert--no-close .portal-alert__close,
#divRegisterPrompt .portal-alert__close,
#divRegisterPrompt button[aria-label="Close"] {
  display: none !important;
}

.portal-alert--no-close .portal-alert__message,
#divRegisterPrompt .portal-alert__message {
  padding-right: 0;
}

#divRegisterPrompt.portal-alert.is-visible,
#divRegisterPrompt.portal-alert[style*="display: block"],
#divRegisterPrompt.portal-alert[style*="display:block"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

#divRegisterPrompt .portal-alert__actions,
#divRegisterPrompt .portal-alert__btn,
#divRegisterPrompt .buy-register-login {
  pointer-events: auto;
}

#divRegisterPrompt.register-prompt--modal-hidden,
#divRegisterPrompt.register-prompt--modal-hidden.is-visible {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.portal-alert--persist::before {
  top: 1.35rem;
  transform: none;
}

.portal-alert__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
  padding-right: 1.5rem;
}

.portal-alert__btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.portal-alert__btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.portal-alert__btn--primary {
  background: #fff;
  color: #9a3412;
  border-color: #fff;
}

.portal-alert__btn--primary:hover {
  background: #fff7ed;
}

/* Login page: always show alert when server or client marks it visible */
#divAlert.login-alert.portal-alert--warning,
#divAlert.login-alert.is-visible,
#divAlert.login-alert[style*="display: block"],
#divAlert.login-alert[style*="display:block"] {
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  transform: translateX(-50%) !important;
}

/* Legacy class compatibility */
.speech-bubble,
.alert {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 520px);
  margin: 0 !important;
  padding: 0.9rem 1rem !important;
  border-radius: 12px;
  z-index: 11000;
}

.speech-bubble.success,
.alert.success,
.portal-alert.success {
  background: #22c55e !important;
}

.speech-bubble.info,
.alert.info,
.portal-alert.info {
  background: #3b82f6 !important;
}

.speech-bubble.warning,
.alert.warning,
.portal-alert.warning {
  background: #f97316 !important;
}

.closebtn {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  margin: 0;
  float: none;
  color: #fff;
  opacity: 0.9;
}

.closebtn:hover {
  color: #fff;
  opacity: 1;
}
