/* Toast host */
#toastHost.toast-host {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: grid;
  gap: 10px;
  width: min(92vw, 360px);
  pointer-events: none;
}

/* Base toast */
.toast {
  pointer-events: auto;
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: start;
  gap: 10px;
  border-radius: 14px;
  padding: 12px 14px;
  color: #0b1220;
  background: #ffffff;
  border: 1.5px solid var(--tone, #93c5fd);
  box-shadow:
    0 10px 30px -10px rgba(0,0,0,.25),
    0 0 14px var(--toneSoft, #93c5fd66),
    inset 0 1px rgba(255,255,255,.6);
  transform: translateY(-8px);
  opacity: 0;
  animation: toast-in 220ms cubic-bezier(.2,.8,.2,1) forwards;
}
.toast .ico {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--tone);
  color: #031122;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 0 12px var(--toneSoft);
}
.toast .body { line-height: 1.25; }
.toast .title { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.toast .msg { font-size: 12.5px; color: #334155; }
.toast .close {
  margin-left: 6px;
  background: transparent;
  border: 0;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 10px;
  cursor: pointer;
}
.toast .close:hover { color: #0f172a; }
.toast .progress {
  position: absolute;
  left: 8px; right: 8px; bottom: 8px;
  height: 3px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--tone), transparent);
  opacity: .9;
  transform-origin: left center;
  animation: toast-progress linear forwards;
}

/* Variants */
.toast.info    { --tone: #60a5fa; --toneSoft: #60a5fa66; }
.toast.success { --tone: #34d399; --toneSoft: #34d39966; }
.toast.error   { --tone: #f43f5e; --toneSoft: #f43f5e66; }
.toast.warn    { --tone: #f59e0b; --toneSoft: #f59e0b66; }

/* Animations */
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toast-out { to { transform: translateY(-8px); opacity: 0; } }
@keyframes toast-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* Input error highlight + shake */
.input-error {
  border-color: #f43f5e !important;
  box-shadow: 0 0 0 2px #f43f5e33 !important;
}
.shake-x { animation: shake-x 400ms cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake-x {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

/* ===== Fancy Modal (reusable) ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(4px) saturate(120%);
  opacity: 0;
  animation: modal-fade-in 160ms ease forwards;
}
@keyframes modal-fade-in { to { opacity: 1; } }

.modal {
  width: min(520px, 96vw);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.14);
  color: #eaf2ff;
  box-shadow: 0 20px 50px rgba(0,0,0,.35), 0 0 40px rgba(16,102,255,.15);
  transform: translateY(10px) scale(.98);

  animation: modal-in 200ms cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes modal-in { to { transform: translateY(0) scale(1); opacity: 1; } }

.modal .hd {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 8px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.modal .hd .badge {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 18px;
  background: linear-gradient(135deg, #f43f5e 0%, #fb7185 100%);
  color: #0b1220;
  box-shadow: 0 0 22px #f43f5e55, inset 0 1px rgba(255,255,255,.6);
  flex: 0 0 auto;
}
.modal .hd .title { font-size: 16px; font-weight: 800; letter-spacing: .2px; }
.modal .bd { padding: 14px 18px 6px; color: #cfe0ff; line-height: 1.45; }
.modal .ft { padding: 12px 18px 16px; display: flex; justify-content: flex-end; gap: 10px; }
.modal .btn { border: 0; border-radius: 12px; padding: 10px 14px; font-weight: 700; cursor: pointer; }
.modal .btn.primary {
  background: linear-gradient(90deg, var(--brand, #00a7ff), var(--brand-2, #6a5cff));
  color: #00122a;
  box-shadow: 0 10px 28px rgba(0,167,255,.25);
}
.modal .btn.ghost { background: transparent; color: #cfe0ff; border: 1px solid rgba(255,255,255,.16); }
.modal .btn:active { transform: translateY(1px); }

/* Small screens */
@media (max-width: 420px) {
  .modal .hd, .modal .bd, .modal .ft { padding-left: 14px; padding-right: 14px; }
}