/* Modal — Design System NOVA PROMOTORA */

:root {
  --nova-bg: #080B12;
  --nova-bg-elev: #0E1421;
  --nova-bg-elev-2: #1A2B40;
  --nova-border: #22304A;
  --nova-navy: #1A2B40;
  --nova-navy-light: #2C4366;
  --nova-blue: #3D7BFF;
  --nova-red: #CF190F;
  --nova-text: #EEF2F8;
  --nova-text-muted: #9AA6BA;
  --nova-text-dim: #5D6880;
  --glass: rgba(255, 255, 255, 0.05);
  --glass-brd: rgba(255, 255, 255, 0.10);
}

html.light {
  --nova-bg: #EEF1F7;
  --nova-bg-elev: #FFFFFF;
  --nova-bg-elev-2: #F5F8FC;
  --nova-border: #D9DFEA;
  --nova-navy: #10182A;
  --nova-navy-light: #4A586E;
  --nova-blue: #2B62D6;
  --nova-red: #DC2626;
  --nova-text: #10182A;
  --nova-text-muted: #4A586E;
  --nova-text-dim: #8A93A6;
  --glass: rgba(16, 24, 42, 0.04);
  --glass-brd: rgba(16, 24, 42, 0.12);
}

/* Overlay + Modal Container */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 150ms ease, visibility 150ms ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Painel Modal */
.modal-panel {
  background-color: var(--nova-bg-elev);
  border: 1px solid var(--nova-border);
  border-radius: 1.125rem; /* 18px */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 32rem; /* 512px */
  width: 90%;
  padding: 0;
  animation: modalSlideIn 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Header */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--nova-border);
  gap: 1rem;
}

.modal-title {
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
  color: var(--nova-text);
  margin: 0;
  font-family: Sora, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--nova-text-muted);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color 150ms ease;
  font-size: 1.5em;
}

.modal-close-btn:hover {
  color: var(--nova-text);
}

.modal-close-btn:focus-visible {
  outline: 2px solid var(--nova-blue);
  outline-offset: 2px;
  border-radius: 0.5rem;
}

/* Body */
.modal-body {
  padding: 1.5rem;
  color: var(--nova-text);
  font-size: 0.9375rem; /* 15px */
  line-height: 1.6;
  font-family: Sora, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Footer */
.modal-footer {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  align-items: center;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--nova-border);
}

/* Botões no Modal */
.modal-btn {
  padding: 0.625rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: 0.75rem; /* 12px */
  cursor: pointer;
  transition: all 150ms ease;
  font-family: Sora, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

/* Botão Primário (Glass) */
.modal-btn.primary {
  background: var(--glass);
  border-color: var(--glass-brd);
  color: var(--nova-text);
}

.modal-btn.primary:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-btn.primary:focus-visible {
  outline: 2px solid var(--nova-blue);
  outline-offset: 2px;
}

.modal-btn.primary:active {
  transform: translateY(1px);
}

.modal-btn.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Botão Secundário Vermelho */
.modal-btn.secondary-red {
  background: rgba(207, 25, 15, 0.13);
  border-color: rgba(207, 25, 15, 0.4);
  color: var(--nova-red);
}

.modal-btn.secondary-red:hover {
  background: rgba(207, 25, 15, 0.18);
  border-color: rgba(207, 25, 15, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(207, 25, 15, 0.15);
}

.modal-btn.secondary-red:focus-visible {
  outline: 2px solid var(--nova-red);
  outline-offset: 2px;
}

.modal-btn.secondary-red:active {
  transform: translateY(1px);
}

.modal-btn.secondary-red:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Botão Ghost */
.modal-btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--nova-text-muted);
}

.modal-btn.ghost:hover {
  color: var(--nova-text);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.modal-btn.ghost:focus-visible {
  outline: 2px solid var(--nova-blue);
  outline-offset: 2px;
}

.modal-btn.ghost:active {
  transform: translateY(1px);
}

.modal-btn.ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Light mode overrides */
html.light .modal-close-btn {
  color: var(--nova-text-muted);
}

html.light .modal-close-btn:hover {
  color: var(--nova-navy);
}

html.light .modal-btn.primary {
  color: var(--nova-navy);
}

html.light .modal-btn.ghost {
  color: var(--nova-text-muted);
}

html.light .modal-btn.ghost:hover {
  color: var(--nova-navy);
}
