.mlf-msgbox-root {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 8, 12, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: mlf-msgbox-fade-in 0.18s ease-out;
}

.mlf-msgbox-root.mlf-msgbox-out {
  animation: mlf-msgbox-fade-out 0.14s ease-in forwards;
}

@keyframes mlf-msgbox-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes mlf-msgbox-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.mlf-msgbox {
  width: min(440px, 100%);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(165deg, #1a2430 0%, #101820 55%, #0c1218 100%);
  color: #eef2f6;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(45, 212, 191, 0.08);
  overflow: hidden;
  transform: translateY(8px) scale(0.98);
  animation: mlf-msgbox-pop 0.22s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  font-family: "DM Sans", Inter, system-ui, sans-serif;
}

.mlf-msgbox-root.mlf-msgbox-out .mlf-msgbox {
  animation: mlf-msgbox-pop-out 0.14s ease-in forwards;
}

@keyframes mlf-msgbox-pop {
  to { transform: translateY(0) scale(1); }
}

@keyframes mlf-msgbox-pop-out {
  to { transform: translateY(6px) scale(0.98); opacity: 0.6; }
}

.mlf-msgbox-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.mlf-msgbox-brand-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.mlf-msgbox-brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.mlf-msgbox-brand-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #d9e2ec;
}

.mlf-msgbox-brand-text span {
  color: #2dd4bf;
}

.mlf-msgbox-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 18px 18px 8px;
}

.mlf-msgbox-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.mlf-msgbox-icon svg {
  width: 22px;
  height: 22px;
}

.mlf-msgbox-icon.info {
  background: rgba(45, 212, 191, 0.14);
  color: #5eead4;
}

.mlf-msgbox-icon.question {
  background: rgba(96, 165, 250, 0.14);
  color: #93c5fd;
}

.mlf-msgbox-icon.warning {
  background: rgba(252, 211, 77, 0.14);
  color: #fcd34d;
}

.mlf-msgbox-icon.error {
  background: rgba(251, 113, 133, 0.14);
  color: #fda4af;
}

.mlf-msgbox-icon.success {
  background: rgba(52, 211, 153, 0.14);
  color: #6ee7b7;
}

.mlf-msgbox-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  margin: 2px 0 6px;
  color: #f8fafc;
}

.mlf-msgbox-message {
  font-size: 14px;
  line-height: 1.55;
  color: #b8c5d1;
  white-space: pre-wrap;
}

.mlf-msgbox-detail {
  margin-top: 8px;
  font-size: 12px;
  color: #8a9ba8;
  line-height: 1.45;
}

.mlf-msgbox-input {
  display: block;
  width: 100%;
  margin-top: 12px;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #eef2f6;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
}

.mlf-msgbox-input:focus {
  outline: 2px solid rgba(45, 212, 191, 0.65);
  outline-offset: 1px;
  border-color: rgba(45, 212, 191, 0.45);
}

.mlf-msgbox-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px 18px;
}

.mlf-msgbox-actions:empty {
  display: none;
  padding: 0 0 18px;
}

.mlf-msgbox-btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 18px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  min-width: 88px;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.mlf-msgbox-btn:active {
  transform: translateY(1px);
}

.mlf-msgbox-btn:focus-visible {
  outline: 2px solid rgba(45, 212, 191, 0.65);
  outline-offset: 2px;
}

.mlf-msgbox-btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
}

.mlf-msgbox-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mlf-msgbox-btn.primary {
  background: linear-gradient(90deg, #0d9488, #2dd4bf);
  color: #042f2e;
  box-shadow: 0 6px 18px rgba(13, 148, 136, 0.28);
}

.mlf-msgbox-btn.primary:hover {
  filter: brightness(1.05);
}

.mlf-msgbox-btn.danger {
  background: linear-gradient(90deg, #be123c, #fb7185);
  color: #fff;
  box-shadow: 0 6px 18px rgba(190, 18, 60, 0.25);
}

.mlf-msgbox-btn.danger:hover {
  filter: brightness(1.05);
}

body.mlf-msgbox-open {
  overflow: hidden;
}

@media (max-width: 480px) {
  .mlf-msgbox-actions {
    flex-direction: column-reverse;
  }

  .mlf-msgbox-btn {
    width: 100%;
  }
}
