/* Ventana Modal y animaciones de entrada: copia de web/css/styles.css (seccion "Modal") para que el panel de Super usuario
   tenga las mismas ventanas que la app. Si se cambia alla, se actualiza aca. */
/* ---- Modal (modal.js): ventana emergente unica de la app. Basado en el Modal de Volt UI:
   fondo oscuro con desenfoque, panel centrado, tres tamaños (sm / md / lg) y tres estados
   (default / danger / success). La animacion de resorte la hace modal.js. ---- */
.vm-root {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.vm-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.65);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.vm-panel {
  position: relative; width: 100%; max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--ink-15); border-radius: 14px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45);
  overflow: hidden; outline: none;
}
.vm-sm { max-width: 384px; }
.vm-md { max-width: 512px; }
.vm-lg { max-width: 672px; }

.vm-header { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 16px; border-bottom: 1px solid var(--ink-15); }
.vm-header[hidden], .vm-error[hidden] { display: none; }
.vm-icon { flex: none; margin-top: 1px; width: 20px; height: 20px; display: flex; }
.vm-icon svg { width: 20px; height: 20px; stroke: currentColor; }
.vm-danger .vm-icon { color: var(--danger); }
.vm-success .vm-icon { color: var(--status-senado); }
.vm-titles { flex: 1; min-width: 0; }
.vm-title { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.3; }
.vm-desc { margin: 6px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink-60); white-space: pre-line; }
.vm-title + .vm-desc { margin-top: 6px; }
.vm-titles > .vm-desc:first-child { margin-top: 0; color: var(--ink); }
.vm-close {
  flex: none; width: 30px; height: 30px; margin: -4px -6px 0 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 8px; color: var(--ink-45); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.vm-close:hover { background: var(--field); color: var(--ink); }
.vm-close svg { width: 16px; height: 16px; stroke: currentColor; }
.vm-close-float { position: absolute; top: 12px; right: 12px; margin: 0; z-index: 2; }

.vm-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px; }
.vm-no-body .vm-body { display: none; }
.vm-no-body .vm-header { border-bottom: none; padding-bottom: 6px; }
.vm-error { margin: 0; padding: 0 20px 12px; font-size: 12.5px; color: var(--danger); }
.vm-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px 18px; border-top: 1px solid var(--ink-15); }
.vm-no-body .vm-footer { border-top: none; padding-top: 12px; }
.vm-no-footer .vm-footer { display: none; }
.vm-footer .btn-primary, .vm-footer .btn-outline { width: auto; margin: 0; padding: 11px 20px; }
.vm-btn-danger { background: var(--danger); color: #fff; }
.vm-btn-ghost { border-color: transparent; }

/* Que los campos de los formularios sigan viendose bien adentro del panel. */
.vm-body .field:last-child { margin-bottom: 0; }
.vm-body .modal-actions { margin-top: 14px; }

@media (max-width: 480px) {
  .vm-root { padding: 12px; }
  .vm-footer { flex-direction: column-reverse; }
  .vm-footer .btn-primary, .vm-footer .btn-outline { width: 100%; }
}

/* ---- Animaciones de entrada (mismo resorte del Modal, ver modal.js). --vm-spring es la curva
   del resorte (rigidez 420, amortiguacion 28) muestreada una vez como linear(); donde el navegador
   no la soporta, la declaracion se ignora y queda una curva comun. Las hojas de detalle
   (.trn-sheet) solo la reproducen al ABRIRSE (clase sheet-enter, la pone modal.js) y no cada
   vez que se repintan por dentro. ---- */
:root { --vm-spring: linear(0, 0.282, 0.609, 0.837, 0.958, 1.007, 1.018, 1.015, 1.009, 1.004, 1.001, 1, 1); }
@keyframes vmFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes vmSheetIn { from { opacity: 0; transform: translateY(28px) scale(0.97); } to { opacity: 1; transform: none; } }
.trn-sheet.sheet-enter { animation: vmFadeIn 0.18s ease-out; }
.trn-sheet.sheet-enter > .trn-sheet-inner { animation: vmSheetIn 0.417s var(--vm-spring) both; }
@media (prefers-reduced-motion: reduce) {
  .modal-overlay, .trn-sheet.sheet-enter, .trn-sheet.sheet-enter > .trn-sheet-inner { animation: none; }

/* El overlay de fondo que usan las ventanas y la animacion de aparicion del texto (de styles.css). */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; z-index: 1000;
  animation: vmFadeIn 0.18s ease-out;
}
