/* Kurumi toast notifications: restyles the stock toastr popups (login, saved,
   errors, ...) into an Aurora "clockwork" card. Pure CSS: toastr's markup,
   timing and API are untouched. */

body.kurumi #toast-container {
  --kt-accent: var(--ka-gold-300, #e8c872);
  --kt-glow: rgba(232, 200, 114, 0.22);
  z-index: 100000;
  pointer-events: none;
}

body.kurumi #toast-container.toast-top-center {
  top: 76px;
}

body.kurumi #toast-container > .toast {
  position: relative;
  pointer-events: auto;
  width: min(440px, calc(100vw - 32px));
  margin: 0 auto 12px;
  padding: 14px 44px 15px 58px;
  overflow: hidden;
  color: var(--ka-ivory, #f4ebda);
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1.45;
  background:
    radial-gradient(120% 140% at 0% 0%, var(--kt-glow), transparent 55%),
    linear-gradient(160deg, rgba(31, 24, 41, 0.97), rgba(16, 13, 23, 0.97)) !important;
  background-image: none;
  border: 1px solid rgba(232, 200, 114, 0.28);
  border-left: 3px solid var(--kt-accent);
  border-radius: 14px;
  opacity: 1;
  box-shadow:
    0 18px 40px -12px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 26px -6px var(--kt-glow);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  text-shadow: none;
}

body.kurumi #toast-container > .toast:hover {
  opacity: 1;
  box-shadow:
    0 22px 46px -12px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 32px -4px var(--kt-glow);
}

/* Icon medallion (replaces toastr's bitmap icons) */
body.kurumi #toast-container > .toast::before {
  content: "\2736";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  display: grid;
  place-items: center;
  font: normal 0.9rem/1 FontAwesome;
  color: var(--kt-accent);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--kt-accent);
  border-radius: 50%;
  box-shadow: inset 0 0 10px var(--kt-glow);
}

body.kurumi #toast-container > .toast-success { --kt-accent: #e8c872; --kt-glow: rgba(232, 200, 114, 0.24); }
body.kurumi #toast-container > .toast-success::before { content: "\f00c"; }

body.kurumi #toast-container > .toast-error,
body.kurumi #toast-container > .toast-danger {
  --kt-accent: var(--ka-crimson-400, #f04a4e);
  --kt-glow: rgba(240, 74, 78, 0.26);
}
body.kurumi #toast-container > .toast-error::before,
body.kurumi #toast-container > .toast-danger::before { content: "\f00d"; }

body.kurumi #toast-container > .toast-warning { --kt-accent: #f0a04a; --kt-glow: rgba(240, 160, 74, 0.24); }
body.kurumi #toast-container > .toast-warning::before { content: "\f071"; }

body.kurumi #toast-container > .toast-info { --kt-accent: #b49bff; --kt-glow: rgba(180, 155, 255, 0.24); }
body.kurumi #toast-container > .toast-info::before { content: "\f129"; font-style: normal; }

/* Override toastr's per-type solid backgrounds and bitmap icons */
body.kurumi #toast-container > .toast-success,
body.kurumi #toast-container > .toast-error,
body.kurumi #toast-container > .toast-danger,
body.kurumi #toast-container > .toast-warning,
body.kurumi #toast-container > .toast-info {
  background-image: none !important;
  background-color: transparent;
}

body.kurumi #toast-container .toast-title {
  margin-bottom: 2px;
  font-family: "Cormorant Garamond", "Playfair Display", serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ka-gold-200, #f3dfa0);
}

body.kurumi #toast-container .toast-message {
  color: var(--ka-ivory-dim, #cfc4b4);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

body.kurumi #toast-container .toast-message a,
body.kurumi #toast-container .toast-message label {
  color: var(--ka-gold-300, #e8c872);
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.kurumi #toast-container .toast-message p { margin: 0; }

body.kurumi #toast-container > .toast .toast-close-button {
  position: absolute;
  top: 8px;
  right: 10px;
  float: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1;
  color: var(--ka-ivory-mute, #b2a797);
  text-shadow: none;
  opacity: 1;
  background: transparent;
  border: 0;
  border-radius: 50%;
  transition: background 0.15s ease, color 0.15s ease;
}

body.kurumi #toast-container > .toast .toast-close-button:hover,
body.kurumi #toast-container > .toast .toast-close-button:focus-visible {
  color: var(--ka-gold-100, #fcf2d2);
  background: rgba(255, 255, 255, 0.09);
  outline: none;
}

body.kurumi #toast-container > .toast .toast-close-button:focus-visible {
  box-shadow: 0 0 0 2px var(--kt-accent);
}

body.kurumi #toast-container > .toast .toast-progress {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--kt-accent));
  opacity: 0.85;
  border-radius: 0 2px 0 0;
}

@media (prefers-reduced-motion: no-preference) {
  body.kurumi #toast-container > .toast {
    animation: kt-in 0.42s cubic-bezier(0.2, 0.9, 0.25, 1.1) both;
  }
  body.kurumi #toast-container > .toast::before {
    animation: kt-pulse 2.8s ease-in-out 0.4s infinite;
  }
}

@keyframes kt-in {
  from { transform: translateY(-18px) scale(0.97); filter: blur(3px); }
  to   { transform: none; filter: none; }
}

@keyframes kt-pulse {
  0%, 100% { box-shadow: inset 0 0 10px var(--kt-glow); }
  50%      { box-shadow: inset 0 0 10px var(--kt-glow), 0 0 14px var(--kt-glow); }
}

@media (max-width: 575px) {
  body.kurumi #toast-container.toast-top-center { top: 64px; }
  body.kurumi #toast-container > .toast { padding: 12px 40px 13px 54px; }
}

/* Beat the older Aurora/dashboard toast rules, which use !important */
body.kurumi #toast-container > .toast {
  padding-left: 58px !important;
  color: var(--ka-ivory, #f4ebda) !important;
  background-color: transparent !important;
  border-left-color: var(--kt-accent) !important;
  box-shadow:
    0 18px 40px -12px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 26px -6px var(--kt-glow) !important;
}

body.kurumi #toast-container > .toast:hover {
  background-color: transparent !important;
}

body.kurumi #toast-container > .toast::before {
  content: "005" !important;
}

body.kurumi #toast-container > .toast-success::before { content: "\f00c" !important; }
body.kurumi #toast-container > .toast-error::before,
body.kurumi #toast-container > .toast-danger::before { content: "\f00d" !important; }
body.kurumi #toast-container > .toast-warning::before { content: "\f071" !important; }
body.kurumi #toast-container > .toast-info::before { content: "\f129" !important; }

body.kurumi #toast-container .toast-title { color: var(--ka-gold-200, #f3dfa0) !important; }
body.kurumi #toast-container .toast-message { color: var(--ka-ivory-dim, #cfc4b4) !important; }
body.kurumi #toast-container .toast-success { border-left-color: #e8c872 !important; }
body.kurumi #toast-container .toast-error,
body.kurumi #toast-container .toast-danger { border-left-color: var(--ka-crimson-400, #f04a4e) !important; }
body.kurumi #toast-container .toast-warning { border-left-color: #f0a04a !important; }
body.kurumi #toast-container .toast-info { border-left-color: #b49bff !important; }
