/* ============================================================
   rx_core — Modal de informação/erro (CANÓNICO, partilhado)
   Substitui o antigo openInfoModal/submit-modal genérico. Usado
   para qualquer mensagem que precise de interromper o utilizador
   com clareza: créditos insuficientes, limites, confirmações, erros.
   Injetado por modal.js (RXModal). Reaproveita o visual já validado
   do submit-modal do dashboard.
   ============================================================ */

.rx-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
html.light .rx-modal { background: rgba(245,244,240,0.7); }
.rx-modal.open { display: flex; }

.rx-modal-box {
  background: var(--ink-2);
  border: 1px solid var(--wire);
  border-radius: 16px;
  padding: 2rem 2.25rem;
  max-width: 360px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
}

.rx-modal-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}
.rx-modal-icon svg { width: 22px; height: 22px; }
.rx-modal-icon--warning { background: rgba(245,166,35,0.12); color: var(--amber); }
.rx-modal-icon--error   { background: rgba(239,68,68,0.12); color: var(--red); }
.rx-modal-icon--info    { background: rgba(136,136,152,0.12); color: var(--text-3); }

.rx-modal-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.rx-modal-message {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.55;
  margin: 0;
}

.rx-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  width: 100%;
  margin-top: 0.375rem;
}

.rx-modal-btn {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.rx-modal-btn--primary {
  background: var(--amber);
  color: var(--ink);
  border-color: var(--amber);
}
.rx-modal-btn--primary:hover { background: var(--amber-2); border-color: var(--amber-2); }

.rx-modal-btn--secondary {
  background: var(--ghost-2);
  color: var(--text-2);
  border-color: var(--wire-2);
}
.rx-modal-btn--secondary:hover { background: var(--ghost-3); color: var(--text); }