/* ─────────────────────────────────────────────────────────────────────────────
   HolaTranslate — modal.css  v2
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Variables de tipo ───────────────────────────────────────────────────────── */
:root {
  --modal-success:    #10B981;
  --modal-success-bg: rgba(16,185,129,.12);
  --modal-error:      #EF4444;
  --modal-error-bg:   rgba(239,68,68,.12);
  --modal-warning:    #F59E0B;
  --modal-warning-bg: rgba(245,158,11,.12);
  --modal-info:       #3B82F6;
  --modal-info-bg:    rgba(59,130,246,.12);
}

/* ── Overlay backdrop ─────────────────────────────────────────────────────────── */
.hm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 20, .72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.hm-overlay--visible {
  opacity: 1;
  visibility: visible;
}

/* ── Modal base ───────────────────────────────────────────────────────────────── */
.hm-modal {
  background: #14142b;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 2.25rem 2rem 1.75rem;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 32px 80px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.04);
  transform: scale(.88) translateY(16px);
  opacity: 0;
  transition: transform .32s cubic-bezier(.34,1.56,.64,1), opacity .28s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  position: relative;
}
.hm-overlay--visible .hm-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* ── Ícono de tipo ────────────────────────────────────────────────────────────── */
.hm-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  flex-shrink: 0;
  animation: hm-pop .4s cubic-bezier(.34,1.56,.64,1) .1s both;
}
.hm-icon--success { background: var(--modal-success-bg); color: var(--modal-success); }
.hm-icon--error   { background: var(--modal-error-bg);   color: var(--modal-error);   }
.hm-icon--warning { background: var(--modal-warning-bg); color: var(--modal-warning); }
.hm-icon--info    { background: var(--modal-info-bg);    color: var(--modal-info);    }

@keyframes hm-pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ── Acento de tipo en borde superior ───────────────────────────────────────── */
.hm-modal--success { border-top: 3px solid var(--modal-success); }
.hm-modal--error   { border-top: 3px solid var(--modal-error);   }
.hm-modal--warning { border-top: 3px solid var(--modal-warning); }
.hm-modal--info    { border-top: 3px solid var(--modal-info);    }

/* ── Textos ───────────────────────────────────────────────────────────────────── */
.hm-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
  line-height: 1.3;
}
.hm-message {
  color: #94a3b8;
  font-size: .95rem;
  line-height: 1.65;
  margin: 0;
}

/* ── Botón cerrar (X) ────────────────────────────────────────────────────────── */
.hm-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(255,255,255,.07);
  border-radius: 8px;
  cursor: pointer;
  color: #64748b;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, color .18s;
  line-height: 1;
}
.hm-close:hover { background: rgba(255,255,255,.14); color: #e2e8f0; }

/* ── Pie de botones ──────────────────────────────────────────────────────────── */
.hm-footer {
  display: flex;
  gap: .65rem;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  margin-top: .25rem;
}

/* Botones dentro del modal */
.hm-btn {
  padding: .6rem 1.5rem;
  border-radius: 10px;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .18s ease;
  min-width: 100px;
}
.hm-btn--primary {
  background: #6c63ff;
  color: #fff;
}
.hm-btn--primary:hover {
  background: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(108,99,255,.45);
}
.hm-btn--outline {
  background: transparent;
  border-color: rgba(255,255,255,.15);
  color: #94a3b8;
}
.hm-btn--outline:hover {
  border-color: rgba(255,255,255,.3);
  color: #e2e8f0;
}
.hm-btn--success { background: var(--modal-success); color: #fff; }
.hm-btn--success:hover { filter: brightness(1.1); }
.hm-btn--danger  { background: var(--modal-error);   color: #fff; }
.hm-btn--danger:hover  { filter: brightness(1.1); }

/* ── Input para HolaModal.prompt ─────────────────────────────────────────────── */
.hm-input-wrap { width: 100%; }
.hm-input {
  width: 100%;
  background: #1e1e35;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  color: #e2e8f0;
  padding: .7rem 1rem;
  font-size: .95rem;
  font-family: inherit;
  transition: border-color .18s, box-shadow .18s;
  text-align: left;
}
.hm-input:focus {
  outline: none;
  border-color: #6c63ff;
  box-shadow: 0 0 0 3px rgba(108,99,255,.22);
}

/* ── Spinner para HolaModal.loading ─────────────────────────────────────────── */
.hm-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255,255,255,.1);
  border-top-color: #6c63ff;
  border-radius: 50%;
  animation: hm-spin .8s linear infinite;
  flex-shrink: 0;
}
@keyframes hm-spin {
  to { transform: rotate(360deg); }
}

.hm-modal--loading {
  border-top: none;
  padding: 2.5rem 2rem;
}

/* ── Toast container — arriba a la derecha ───────────────────────────────────── */
.hm-toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  align-items: flex-end;
  pointer-events: none;
}

.hm-toast {
  background: #1a1a30;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: .75rem 1.1rem .75rem .9rem;
  font-size: .875rem;
  font-weight: 500;
  color: #e2e8f0;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: .65rem;
  pointer-events: all;
  animation: hm-toastIn .3s cubic-bezier(.34,1.4,.64,1) both;
  position: relative;
  overflow: hidden;
}

/* Barra de progreso inferior */
.hm-toast::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  border-radius: 0 0 12px 12px;
  transform-origin: left;
  animation: hm-toastBar var(--hm-toast-dur, 3s) linear forwards;
}
.hm-toast--success { border-left: 3px solid var(--modal-success); }
.hm-toast--success::after { background: var(--modal-success); }
.hm-toast--error   { border-left: 3px solid var(--modal-error);   }
.hm-toast--error::after   { background: var(--modal-error);   }
.hm-toast--warning { border-left: 3px solid var(--modal-warning); }
.hm-toast--warning::after { background: var(--modal-warning); }
.hm-toast--info    { border-left: 3px solid var(--modal-info);    }
.hm-toast--info::after    { background: var(--modal-info);    }

.hm-toast__icon { font-size: 1.1rem; flex-shrink: 0; }
.hm-toast__text { flex: 1; line-height: 1.4; }
.hm-toast__close {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: .8rem;
  padding: 0 0 0 .25rem;
  flex-shrink: 0;
  transition: color .15s;
}
.hm-toast__close:hover { color: #e2e8f0; }

@keyframes hm-toastIn {
  from { opacity: 0; transform: translateX(24px) scale(.95); }
  to   { opacity: 1; transform: translateX(0)    scale(1);   }
}
@keyframes hm-toastBar {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ── Backward-compat aliases (modal-overlay, modal, toast-container) ────────── */
.modal-overlay         { display: none; }
.toast-container       { display: none; }
