
/* =========================================================
   MENSAGENS GLOBAIS / TOASTS
========================================================= */
.app-messages {
  position: fixed;
  top: 82px;
  right: 18px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100vw - 28px));
  pointer-events: none;
}

.app-message {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 38px 1fr 30px;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .10);
  box-shadow: 0 18px 45px rgba(15, 23, 42, .16);
  color: #0f172a;
  animation: appMsgIn .22s ease both;
  overflow: hidden;
  position: relative;
}

.app-message::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #2563eb;
}

.app-message__icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, .10);
  color: #2563eb;
  font-size: 17px;
}

.app-message__title {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.2;
}

.app-message__text {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.app-message__close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-message__close:hover {
  background: #eef2f7;
  color: #0f172a;
}

.app-message.is-success::before { background: #16a34a; }
.app-message.is-success .app-message__icon {
  background: rgba(22, 163, 74, .11);
  color: #16a34a;
}

.app-message.is-error::before,
.app-message.is-danger::before { background: #dc2626; }
.app-message.is-error .app-message__icon,
.app-message.is-danger .app-message__icon {
  background: rgba(220, 38, 38, .11);
  color: #dc2626;
}

.app-message.is-warning::before { background: #f59e0b; }
.app-message.is-warning .app-message__icon {
  background: rgba(245, 158, 11, .13);
  color: #b45309;
}

.app-message.is-info::before { background: #2563eb; }
.app-message.is-info .app-message__icon {
  background: rgba(37, 99, 235, .10);
  color: #2563eb;
}

.app-message.is-debug::before { background: #7c3aed; }
.app-message.is-debug .app-message__icon {
  background: rgba(124, 58, 237, .10);
  color: #7c3aed;
}

.app-message.is-hiding {
  animation: appMsgOut .18s ease both;
}

@keyframes appMsgIn {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes appMsgOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(.98); }
}

/* =========================================================
   ERROS DE FORMULÁRIO
========================================================= */
.errorlist {
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
  color: #b91c1c;
  font-size: 12.5px;
  font-weight: 800;
}

.errorlist li {
  margin: 4px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"],
.is-invalid {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, .10) !important;
}

/* =========================================================
   PÁGINAS DE ERRO
========================================================= */
.error-page {
  min-height: calc(100vh - 220px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px 14px;
}

.error-card {
  width: 100%;
  max-width: 720px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 24px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 22px 60px rgba(15, 23, 42, .10);
}

.error-icon {
  width: 74px;
  height: 74px;
  border-radius: 24px;
  margin: 0 auto 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, .10);
  color: #2563eb;
  font-size: 30px;
}

.error-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 10px;
}

.error-card h1 {
  margin: 0;
  color: #101828;
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 950;
  letter-spacing: -.04em;
  line-height: 1.05;
}

.error-card p {
  max-width: 560px;
  margin: 12px auto 0;
  color: #667085;
  font-size: 15px;
  line-height: 1.55;
}

.error-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.error-actions a,
.error-actions button {
  min-height: 42px;
  padding: 10px 15px;
  border-radius: 12px;
  border: 0;
  background: #2563eb;
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.error-actions .secondary {
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #e5e7eb;
}

@media(max-width: 720px) {
  .app-messages {
    top: 74px;
    left: 12px;
    right: 12px;
    width: auto;
  }

  .app-message {
    grid-template-columns: 34px 1fr 28px;
    border-radius: 14px;
    padding: 12px 10px;
  }

  .app-message__icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }

  .error-card {
    padding: 22px 16px;
    border-radius: 20px;
  }

  .error-actions {
    flex-direction: column;
  }

  .error-actions a,
  .error-actions button {
    width: 100%;
  }
}


/* =========================================================
   AJUSTE PÁGINA DE ERRO - ÍCONE ÚNICO DE ATENÇÃO
========================================================= */
.error-card {
  text-align: center !important;
}

.error-icon {
  width: 70px !important;
  height: 70px !important;
  border-radius: 999px !important;
  margin: 0 auto 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #fff7ed !important;
  color: #ea580c !important;
  font-size: 30px !important;
  border: 1px solid #fed7aa !important;
}

.error-code {
  font-weight: 500 !important;
}

.error-card h1 {
  font-weight: 500 !important;
  letter-spacing: -0.02em !important;
}

.error-card p {
  font-weight: 400 !important;
}

.error-actions a,
.error-actions button {
  font-weight: 500 !important;
}

.error-actions i {
  display: none !important;
}


/* =========================================================
   AJUSTE FINAL PÁGINA DE ERRO - CÓDIGO ABAIXO DO ÍCONE
========================================================= */
.error-icon {
  margin: 0 auto 12px !important;
}

.error-code {
  display: block !important;
  width: fit-content !important;
  margin: 0 auto 12px !important;
  padding: 7px 14px !important;
  border-radius: 999px !important;
  background: #fff7ed !important;
  border: 1px solid #fed7aa !important;
  color: #c2410c !important;
  font-size: 18px !important;
  line-height: 1.2 !important;
  font-weight: 600 !important;
}

.error-card h1 {
  margin-top: 0 !important;
  font-size: clamp(30px, 5vw, 46px) !important;
  font-weight: 500 !important;
  line-height: 1.08 !important;
}

.error-card p {
  margin-top: 14px !important;
  font-size: 16px !important;
  font-weight: 400 !important;
}
