/* ==============================================================================
   FORNO & BRASA - SISTEMA GLOBAL DE DIÁLOGOS, TOASTS & MODAIS (DESIGN SYSTEM)
   ============================================================================== */

/* Container de Toasts Flutuantes */
#fb-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 420px;
  width: calc(100% - 40px);
}

@media (max-width: 640px) {
  #fb-toast-container {
    top: 14px;
    right: 14px;
    left: 14px;
    width: auto;
    max-width: none;
  }
}

/* Card do Toast */
.fb-toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 14px;
  padding: 14px 16px 16px 14px;
  box-shadow: 0 20px 30px -8px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
  animation: fbToastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.fb-toast.fb-toast-leaving {
  animation: fbToastSlideOut 0.28s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

@keyframes fbToastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fbToastSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-16px) scale(0.94);
  }
}

/* Ícone do Toast */
.fb-toast-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.fb-toast-icon svg {
  width: 18px;
  height: 18px;
}

/* Tipos de Toast */
.fb-toast.success {
  border-left: 4px solid #10b981;
  box-shadow: 0 20px 30px -8px rgba(0, 0, 0, 0.65), 0 0 18px rgba(16, 185, 129, 0.15);
}
.fb-toast.success .fb-toast-icon {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
}

.fb-toast.error {
  border-left: 4px solid #ef4444;
  box-shadow: 0 20px 30px -8px rgba(0, 0, 0, 0.65), 0 0 18px rgba(239, 68, 68, 0.18);
}
.fb-toast.error .fb-toast-icon {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
}

.fb-toast.warning {
  border-left: 4px solid #f59e0b;
  box-shadow: 0 20px 30px -8px rgba(0, 0, 0, 0.65), 0 0 18px rgba(245, 158, 11, 0.16);
}
.fb-toast.warning .fb-toast-icon {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
}

.fb-toast.info {
  border-left: 4px solid #3b82f6;
  box-shadow: 0 20px 30px -8px rgba(0, 0, 0, 0.65), 0 0 18px rgba(59, 130, 246, 0.15);
}
.fb-toast.info .fb-toast-icon {
  background: rgba(59, 130, 246, 0.16);
  color: #60a5fa;
}

.fb-toast.loading {
  border-left: 4px solid #f97316;
  box-shadow: 0 20px 30px -8px rgba(0, 0, 0, 0.65), 0 0 18px rgba(249, 115, 22, 0.2);
}
.fb-toast.loading .fb-toast-icon {
  background: rgba(249, 115, 22, 0.16);
  color: #fb923c;
}

.fb-toast-icon svg.fb-spinner {
  animation: fbSpin 0.9s linear infinite;
}

@keyframes fbSpin {
  100% { transform: rotate(360deg); }
}

/* Conteúdo do Toast */
.fb-toast-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fb-toast-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.3;
}

.fb-toast-message {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-line;
}

/* Botão de Fechar */
.fb-toast-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  margin: -4px -4px 0 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.fb-toast-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

.fb-toast-close svg {
  width: 15px;
  height: 15px;
}

/* Barra de Progresso no Toast */
.fb-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  transform-origin: left;
}

.fb-toast.success .fb-toast-progress {
  background: #10b981;
}
.fb-toast.error .fb-toast-progress {
  background: #ef4444;
}
.fb-toast.warning .fb-toast-progress {
  background: #f59e0b;
}
.fb-toast.info .fb-toast-progress {
  background: #3b82f6;
}

/* ==============================================================================
   MODAL DE CONFIRMAÇÃO & PROMPT (MODERN DIALOG)
   ============================================================================== */

.fb-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999999;
  background: rgba(4, 7, 13, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fbFadeIn 0.25s ease forwards;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.fb-modal-overlay.fb-modal-closing {
  animation: fbFadeOut 0.2s ease forwards;
}

@keyframes fbFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fbFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.fb-modal-box {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
  max-width: 460px;
  width: 100%;
  overflow: hidden;
  animation: fbModalScaleIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  display: flex;
  flex-direction: column;
}

.fb-modal-overlay.fb-modal-closing .fb-modal-box {
  animation: fbModalScaleOut 0.2s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

@keyframes fbModalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes fbModalScaleOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
}

.fb-modal-header {
  padding: 22px 24px 12px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.fb-modal-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fb-modal-icon-badge svg {
  width: 24px;
  height: 24px;
}

.fb-modal-icon-badge.warning {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.fb-modal-icon-badge.danger {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.fb-modal-icon-badge.info {
  background: rgba(59, 130, 246, 0.16);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.fb-modal-icon-badge.success {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.fb-modal-title-area h3 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.3;
}

.fb-modal-body {
  padding: 0 24px 20px 24px;
  color: #94a3b8;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-line;
}

/* Campo para Prompt */
.fb-modal-prompt-input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 14px;
  background: rgba(30, 41, 59, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 12px 14px;
  color: #f8fafc;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fb-modal-prompt-input:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

.fb-modal-footer {
  padding: 16px 24px;
  background: rgba(11, 15, 25, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.fb-dialog-btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.90rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.fb-dialog-btn-cancel {
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.fb-dialog-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.fb-dialog-btn-confirm {
  background: linear-gradient(135deg, #ea580c, #f97316);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
}

.fb-dialog-btn-confirm:hover {
  background: linear-gradient(135deg, #c2410c, #ea580c);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.45);
}

.fb-dialog-btn-confirm.danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}

.fb-dialog-btn-confirm.danger:hover {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.45);
}
