/* ============================================================================
 * R4W Modal — caixas de diálogo padronizadas (substitui alert/confirm nativos)
 * Visual baseado no passwordModal existente em home.html (verde + branco).
 * Inclua junto com modal.js em todas as páginas que precisem de diálogos.
 * ========================================================================== */

.r4w-modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(27, 37, 24, 0.45);
  z-index: 100000;
  padding: 18px;
  font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  animation: r4w-modal-backdrop-in 0.15s ease-out;
}

.r4w-modal-backdrop.r4w-modal-visible {
  display: flex;
}

@keyframes r4w-modal-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.r4w-modal-box {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid #d8dcd5;
  border-radius: 4px;
  padding: 24px 24px 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .18);
  animation: r4w-modal-box-in 0.18s ease-out;
}

@keyframes r4w-modal-box-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.r4w-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #2f5e24;
  margin: 0 0 8px;
}

.r4w-modal-message {
  font-size: 14px;
  color: #4a5247;
  line-height: 1.5;
  margin: 0 0 18px;
  white-space: pre-wrap;
}

.r4w-modal-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #c8cdc4;
  border-radius: 3px;
  margin: 0 0 16px;
  font-family: inherit;
  box-sizing: border-box;
}

.r4w-modal-input:focus {
  outline: none;
  border-color: #2f5e24;
  box-shadow: 0 0 0 3px rgba(47, 94, 36, 0.15);
}

.r4w-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.r4w-modal-btn {
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s;
  min-width: 90px;
}

.r4w-modal-btn-primary {
  background: #2f5e24;
  color: #fff;
}
.r4w-modal-btn-primary:hover  { background: #244a1c; }
.r4w-modal-btn-primary:focus  { outline: 2px solid #244a1c; outline-offset: 2px; }

.r4w-modal-btn-secondary {
  background: #fff;
  color: #4a5247;
  border-color: #c8cdc4;
}
.r4w-modal-btn-secondary:hover { background: #f3f5f0; border-color: #a9b0a3; }
.r4w-modal-btn-secondary:focus { outline: 2px solid #a9b0a3; outline-offset: 2px; }

.r4w-modal-btn-danger {
  background: #b3392b;
  color: #fff;
}
.r4w-modal-btn-danger:hover  { background: #8e2c20; }
.r4w-modal-btn-danger:focus  { outline: 2px solid #8e2c20; outline-offset: 2px; }
