/**
 * Alerts globais — alinhados aos notices (dashboard, finanças, subscrição, visão geral)
 */

:root {
  --app-alert-radius: 0.85rem;
  --app-alert-border: var(--color-border, #e5e7eb);
}

.alert {
  position: relative;
  margin-bottom: 1rem;
  padding: 0.85rem 1.05rem;
  border: 1px solid var(--app-alert-border);
  border-radius: var(--app-alert-radius);
  background: #fff;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.04));
  color: var(--color-text, #1f2937);
  font-size: 0.875rem;
  line-height: 1.45;
}

.alert > .bi:first-child,
.alert > i.bi:first-child {
  margin-right: 0.35rem;
  vertical-align: -0.1em;
  font-size: 1.05em;
}

.alert .alert-heading {
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
  font-weight: 650;
  color: inherit;
}

.alert.alert-dismissible {
  padding-right: 3rem;
}

.alert .btn-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  transform: none;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  margin: 0;
  border-radius: 0.45rem;
  background-color: transparent;
  background-size: 0.7em;
  opacity: 0.55;
  box-sizing: border-box;
  transition: opacity 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.alert .btn-close:hover,
.alert .btn-close:focus {
  opacity: 1;
  background-color: rgba(15, 23, 42, 0.08);
  box-shadow: none;
}

.alert .btn-close:focus-visible {
  outline: 2px solid rgba(15, 23, 42, 0.25);
  outline-offset: 1px;
}

.alert .btn-close:active {
  transform: scale(0.96);
}

.alert-success .btn-close:hover,
.alert-success .btn-close:focus {
  background-color: rgba(22, 163, 74, 0.14);
}

.alert-danger .btn-close:hover,
.alert-danger .btn-close:focus {
  background-color: rgba(220, 38, 38, 0.12);
}

.alert-warning .btn-close:hover,
.alert-warning .btn-close:focus {
  background-color: rgba(217, 119, 6, 0.14);
}

.alert-info .btn-close:hover,
.alert-info .btn-close:focus {
  background-color: rgba(37, 99, 235, 0.12);
}

.alert-primary .btn-close:hover,
.alert-primary .btn-close:focus {
  background-color: rgba(224, 121, 32, 0.14);
}

.alert.alert-sm .btn-close,
.alert.py-2 .btn-close {
  width: 1.65rem;
  height: 1.65rem;
  top: 0.4rem;
  right: 0.45rem;
}

.alert p:last-child,
.alert ul:last-child {
  margin-bottom: 0;
}

.alert hr {
  margin: 0.65rem 0;
  border-color: rgba(0, 0, 0, 0.08);
  opacity: 1;
}

.alert .alert-link {
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Variants — soft tint + subtle border (same language as page notices) */
.alert-primary {
  background: rgba(224, 121, 32, 0.07);
  border-color: rgba(224, 121, 32, 0.35);
  color: #9a4e0e;
}

.alert-primary > .bi:first-child,
.alert-primary > i.bi:first-child,
.alert-primary .alert-heading .bi {
  color: var(--color-primary, #e07920);
}

.alert-success {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.alert-success > .bi:first-child,
.alert-success > i.bi:first-child,
.alert-success .alert-heading .bi {
  color: #16a34a;
}

.alert-danger {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.alert-danger > .bi:first-child,
.alert-danger > i.bi:first-child,
.alert-danger .alert-heading .bi {
  color: #dc2626;
}

.alert-warning {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

.alert-warning > .bi:first-child,
.alert-warning > i.bi:first-child,
.alert-warning .alert-heading .bi {
  color: #d97706;
}

.alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e3a8a;
}

.alert-info > .bi:first-child,
.alert-info > i.bi:first-child,
.alert-info .alert-heading .bi {
  color: #2563eb;
}

.alert-secondary,
.alert-light {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #374151;
}

.alert-secondary > .bi:first-child,
.alert-light > .bi:first-child,
.alert-secondary > i.bi:first-child,
.alert-light > i.bi:first-child {
  color: #6b7280;
}

.alert-dark {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #1f2937;
}

.alert.alert-sm,
.alert.py-2 {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

/* Full-bleed banners */
.impersonation-banner.alert {
  border-radius: 0 !important;
  box-shadow: none;
}

/* Optional notice utility for new markup (flex + icon) */
.app-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--app-alert-radius);
  border: 1px solid var(--app-alert-border);
  background: #fff;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.04));
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--color-text, #1f2937);
}

.app-notice > i,
.app-notice > .bi {
  font-size: 1.15rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.app-notice.is-warning,
.app-notice.alert-warning {
  border-color: #fcd34d;
  background: #fffbeb;
}
.app-notice.is-warning > i,
.app-notice.alert-warning > i { color: #d97706; }

.app-notice.is-info,
.app-notice.alert-info {
  border-color: #bfdbfe;
  background: #eff6ff;
}
.app-notice.is-info > i,
.app-notice.alert-info > i { color: #2563eb; }

.app-notice.is-danger,
.app-notice.alert-danger {
  border-color: #fca5a5;
  background: #fef2f2;
}
.app-notice.is-danger > i,
.app-notice.alert-danger > i { color: #dc2626; }

.app-notice.is-success,
.app-notice.alert-success {
  border-color: #86efac;
  background: #f0fdf4;
}
.app-notice.is-success > i,
.app-notice.alert-success > i { color: #16a34a; }

.app-notice-actions {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
