/* ── Sistema de Alertas Personalizados Freedom ─────────────────────────── */

#custom-alert-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.custom-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #333;
  color: #fff;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-family: inherit;
  line-height: 1.45;
  opacity: 0;
  transform: translateX(30px) scale(0.96);
  transition: opacity 0.28s ease, transform 0.28s ease;
  min-width: 230px;
  max-width: min(340px, calc(100vw - 32px));
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.12);
  pointer-events: auto;
  word-break: break-word;
}

/* Entrada */
.custom-alert.show {
  opacity: 1;
  transform: translateX(0) scale(1);
}

/* Saída */
.custom-alert.hide {
  opacity: 0;
  transform: translateX(30px) scale(0.96);
}

/* Ícone */
.custom-alert .alert-icon {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Texto — preserva \n como quebras de linha */
.custom-alert .alert-message {
  white-space: pre-line;
  flex: 1;
}

/* Barra de progresso */
.custom-alert .alert-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 12px 12px;
  background: rgba(255, 255, 255, 0.45);
  width: 100%;
  transform-origin: left;
  animation: alertProgress var(--alert-duration, 3.5s) linear forwards;
}

@keyframes alertProgress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* Tipos */
.custom-alert.success {
  background: linear-gradient(135deg, #16a34a, #22c55e);
}
.custom-alert.error {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}
.custom-alert.warning {
  background: linear-gradient(135deg, #ea580c, #f97316);
}
.custom-alert.info {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
}

/* Mobile: ancorar em baixo */
@media (max-width: 480px) {
  #custom-alert-container {
    top: auto;
    bottom: 80px;          /* acima da nav bar */
    right: 12px;
    left: 12px;
    align-items: stretch;
  }

  .custom-alert {
    max-width: 100%;
    transform: translateY(20px) scale(0.97);
  }

  .custom-alert.show {
    transform: translateY(0) scale(1);
  }

  .custom-alert.hide {
    transform: translateY(20px) scale(0.97);
  }
}

/* ── Modal de confirmação (showConfirm) ──────────────────────────── */
.mc-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: background 0.22s ease;
}
.mc-confirm-overlay.mc-confirm-show {
  background: rgba(0, 0, 0, 0.48);
}
.mc-confirm-overlay.mc-confirm-hide {
  background: rgba(0, 0, 0, 0);
}

.mc-confirm-box {
  background: var(--surface,#1A1A1A);
  border-radius: 20px;
  padding: 28px 24px 20px;
  width: min(340px, calc(100vw - 40px));
  box-shadow: 0 20px 60px rgba(0,0,0,.22), 0 4px 16px rgba(0,0,0,.1);
  text-align: center;
  transform: scale(0.88) translateY(16px);
  opacity: 0;
  transition: transform 0.26s cubic-bezier(.34,1.56,.64,1), opacity 0.22s ease;
}
.mc-confirm-overlay.mc-confirm-show .mc-confirm-box {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.mc-confirm-overlay.mc-confirm-hide .mc-confirm-box {
  transform: scale(0.93) translateY(10px);
  opacity: 0;
}

.mc-confirm-icon {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mc-confirm-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--tx, #F0F4FF);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.mc-confirm-msg {
  font-size: 13.5px;
  color: var(--tx3, #6B7A99);
  line-height: 1.55;
  white-space: pre-line;
  margin-bottom: 22px;
}

.mc-confirm-actions {
  display: flex;
  gap: 10px;
}

.mc-confirm-btn {
  flex: 1;
  padding: 12px 8px;
  border-radius: 12px;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.mc-confirm-btn:active {
  opacity: 0.85;
  transform: scale(0.97);
}

.mc-confirm-cancel {
  background: var(--bg, #111);
  color: var(--tx3, #6B7A99);
}
.mc-confirm-cancel:hover {
  background: rgba(255,255,255,0.08);
}

.mc-confirm-ok {
  color: #fff;
}

/* ── showPrompt / showForm ─────────────────────────────────────────── */
.mc-prompt-input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1.5px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--tx, #F0F4FF);
  background: var(--bg, #141e38);
  outline: none;
  transition: border-color 0.15s;
}
.mc-prompt-input:focus {
  border-color: #00C2FF;
  background: var(--surface,#1A1A1A);
}
.mc-prompt-textarea {
  resize: vertical;
  min-height: 72px;
}
.mc-prompt-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

/* showForm: box um pouco mais larga, campos empilhados */
.mc-form-box {
  width: min(400px, calc(100vw - 40px)) !important;
  text-align: left !important;
}
.mc-form-fields {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mc-form-field {
  display: flex;
  flex-direction: column;
}
.mc-form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--tx3, #6B7A99);
  margin-top: 12px;
  margin-bottom: 2px;
}
.mc-form-field .mc-prompt-input {
  margin-top: 0;
}