/* Shared Serra Dental toast — public site + admin */

.toast-stack {
  position: fixed;
  top: 1.15rem;
  right: 1.15rem;
  z-index: 13000;
  width: min(22rem, calc(100vw - 2.3rem));
  max-width: calc(100vw - 2.3rem);
  pointer-events: none;
}

.toast-item {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.7rem 0.8rem;
  overflow: hidden;
  padding: 1rem 0.9rem 1.05rem 1.05rem;
  border: 1px solid rgba(197, 181, 154, 0.28);
  border-radius: 22px;
  background: #142433;
  color: #f4efe6;
  font-family: "Lexend", sans-serif;
  box-shadow: 0 18px 40px rgba(20, 36, 51, 0.28);
  opacity: 0;
  transform: translate3d(1rem, 0, 0);
  transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.22, 0.8, 0.24, 1);
  pointer-events: auto;
}

.toast-item.is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.toast-item.is-bump {
  animation: toast-bump 0.38s cubic-bezier(0.22, 0.8, 0.24, 1);
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 0.18rem;
  color: #c5b59a;
}

.toast-item.is-error .toast-icon,
.toast-item.is-warning .toast-icon {
  color: #ead9bc;
}

.toast-icon svg {
  display: block;
}

.toast-copy {
  min-width: 0;
}

.toast-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: #fff;
}

.toast-text {
  margin: 0.28rem 0 0;
  font-size: 0.86rem;
  font-weight: 450;
  line-height: 1.45;
  color: rgba(244, 239, 230, 0.72);
}

.toast-text:only-child {
  margin-top: 0.05rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #f4efe6;
}

.toast-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: -0.2rem -0.15rem 0 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(244, 239, 230, 0.45);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.toast-close:hover,
.toast-close:focus {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.toast-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #c5b59a;
  transform-origin: left center;
  transform: scaleX(1);
}

.toast-item.is-in .toast-bar {
  animation: toast-bar linear forwards;
}

.toast-item.is-error .toast-bar,
.toast-item.is-warning .toast-bar {
  background: #ead9bc;
}

@keyframes toast-bar {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@keyframes toast-bump {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  45% { transform: translate3d(0, 0, 0) scale(1.02); }
}

.field-validation-error,
.field-validation-valid,
.validation-summary-errors,
.admin-form-error,
[data-valmsg-for] {
  display: none !important;
}

.admin-login-body .toast-stack {
  top: 1.15rem;
  right: 1.15rem;
  left: auto;
  bottom: auto;
  width: min(22rem, calc(100vw - 2.3rem));
}

@media (max-width: 991.98px) {
  .toast-stack {
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: 14px;
    left: auto;
    bottom: auto;
    width: min(22rem, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
  }

  .admin-login-body .toast-stack {
    top: 1.15rem;
    right: 1.15rem;
    left: auto;
    bottom: auto;
    width: min(22rem, calc(100vw - 2.3rem));
  }

  .toast-item {
    transform: translate3d(0, -0.6rem, 0);
  }

  .toast-item.is-in {
    transform: translate3d(0, 0, 0);
  }

  .toast-item.is-solo {
    align-items: center;
    padding: 0.68rem 0.7rem 0.72rem 0.9rem;
    gap: 0.5rem 0.65rem;
  }

  .toast-item.is-solo .toast-icon {
    margin-top: 0;
  }

  .toast-item.is-solo .toast-title,
  .toast-item.is-solo .toast-text {
    margin: 0;
  }

  .toast-item.is-solo .toast-close {
    width: 28px;
    height: 28px;
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast-item,
  .toast-item.is-bump {
    transform: none;
    animation: none;
    transition: opacity 0.2s ease;
  }

  .toast-item.is-in .toast-bar {
    animation: none;
  }
}
