/*
 * Padrão de alertas do sistema — Claude Design "Customizar SweetAlert para design moderno"
 * (projeto a78f2033-9ca6-4958-9f4e-fdcfbe30eee8, arquivo Alertas.dc.html).
 *
 * Veste o SweetAlert2 (8.8.1) com a identidade do sistema: card clean, ícone de traço
 * em círculo tonalizado no lugar das ilustrações animadas, e botões chapados.
 * O tipo do alerta chega como classe .swal-fd--<tipo> no popup (assets/js/swal-firmar.js).
 *
 * O CSS do SweetAlert2 é injetado pelo próprio JS, depois deste arquivo no <head> — por isso
 * as regras abaixo precisam de especificidade maior (ou !important) para vencer o cascade.
 *
 * Toasts (Swal.mixin({toast:true})) ficam fora deste padrão: mantêm o formato compacto.
 */

.swal-fd {
    --swal-fd-accent: #4C3F9E;
    --swal-fd-tint: #ece9f9;
}

.swal-fd--success { --swal-fd-accent: #1f7a44; --swal-fd-tint: #e5f4ea; }
.swal-fd--error   { --swal-fd-accent: #b3313f; --swal-fd-tint: #fbe9ea; }
.swal-fd--warning { --swal-fd-accent: #9a6a12; --swal-fd-tint: #fbf1dc; }
.swal-fd--info    { --swal-fd-accent: #2461ad; --swal-fd-tint: #e6f0fb; }
.swal-fd--question{ --swal-fd-accent: #4C3F9E; --swal-fd-tint: #ece9f9; }

/* ---------- Overlay ---------- */

body:not(.swal2-toast-shown) .swal2-container.swal2-shown {
    background: rgba(24, 24, 40, 0.45) !important;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    -webkit-animation: swal-fd-overlay 180ms ease;
    animation: swal-fd-overlay 180ms ease;
}

@-webkit-keyframes swal-fd-overlay { from { opacity: 0 } to { opacity: 1 } }
@keyframes swal-fd-overlay { from { opacity: 0 } to { opacity: 1 } }

/* ---------- Card ---------- */

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) {
    width: 380px;
    max-width: calc(100vw - 40px);
    padding: 36px 32px 28px;
    border-radius: 10px;
    box-shadow: 0 24px 60px rgba(20, 20, 50, 0.25);
    align-items: center;
    font-family: inherit;
}

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast).swal2-show {
    -webkit-animation: swal-fd-show 220ms cubic-bezier(.2, .8, .2, 1);
    animation: swal-fd-show 220ms cubic-bezier(.2, .8, .2, 1);
}

/* forwards, como no .swal2-hide original: o SweetAlert só remove o popup no animationend,
   e sem o fill o card volta à opacidade cheia entre o fim da animação e a remoção */
.swal2-container .swal2-popup.swal-fd:not(.swal2-toast).swal2-hide {
    -webkit-animation: swal-fd-hide 140ms ease-out forwards;
    animation: swal-fd-hide 140ms ease-out forwards;
}

@-webkit-keyframes swal-fd-show { from { -webkit-transform: scale(.94); opacity: 0 } to { -webkit-transform: scale(1); opacity: 1 } }
@keyframes swal-fd-show { from { transform: scale(.94); opacity: 0 } to { transform: scale(1); opacity: 1 } }
@-webkit-keyframes swal-fd-hide { from { -webkit-transform: scale(1); opacity: 1 } to { -webkit-transform: scale(.96); opacity: 0 } }
@keyframes swal-fd-hide { from { transform: scale(1); opacity: 1 } to { transform: scale(.96); opacity: 0 } }

/* ---------- Ícone: círculo tonalizado + traço (substitui a ilustração do SweetAlert) ---------- */

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-icon {
    width: 52px;
    min-width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    border: 0 !important;
    border-radius: 50%;
    background-color: var(--swal-fd-tint);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 22px;
    line-height: 52px;
}

/* Esconde a ilustração padrão: anéis/riscos animados são filhos, e o glifo
   de "?", "!" e "i" (question/warning/info) vem do ::before do próprio ícone */
.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-icon *,
.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-icon::before {
    display: none !important;
}

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-icon.swal2-question {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234C3F9E' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 9a2.5 2.5 0 1 1 3.6 2.25c-.9.5-1.1 1-1.1 2.15'/%3E%3Ccircle cx='12' cy='17.2' r='.6' fill='%234C3F9E' stroke='none'/%3E%3C/svg%3E");
}

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-icon.swal2-success {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f7a44' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E");
}

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-icon.swal2-error {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b3313f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E");
}

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-icon.swal2-warning {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a6a12' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 8.5v5'/%3E%3Ccircle cx='12' cy='16.5' r='.6' fill='%239a6a12' stroke='none'/%3E%3C/svg%3E");
}

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-icon.swal2-info {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232461ad' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 10.5v6'/%3E%3Ccircle cx='12' cy='7.3' r='.6' fill='%232461ad' stroke='none'/%3E%3C/svg%3E");
}

/* ---------- Texto ---------- */

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-title {
    margin: 0 0 6px;
    padding: 0;
    color: #23223b;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
}

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-content {
    max-width: 280px;
    margin: 0 auto 18px;
    padding: 0;
    color: #6b6b85;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
}

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-content:empty {
    margin-bottom: 0;
}

/* ---------- Botões ---------- */

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-actions {
    width: 100%;
    margin: 0;
    flex-wrap: nowrap;
    gap: 10px;
}

/*
 * Ancorado em .swal2-confirm/.swal2-cancel, e não em .swal2-styled: chamadas com
 * buttonsStyling:false (que passam classes do bootstrap) não recebem .swal2-styled,
 * e mesmo assim precisam seguir o padrão. O margin vai com !important porque as
 * utilities do bootstrap (mr-2 etc.) nessas chamadas também são !important.
 * :not(.swal2-loading) preserva o spinner que o SweetAlert monta sobre o confirmar.
 */
.swal2-container .swal2-popup.swal-fd:not(.swal2-toast):not(.swal2-loading) .swal2-actions .swal2-confirm,
.swal2-container .swal2-popup.swal-fd:not(.swal2-toast):not(.swal2-loading) .swal2-actions .swal2-cancel {
    flex: 1 1 0;
    margin: 0 !important;
    padding: 12px 0;
    border: 0;
    border-radius: 4px;
    box-shadow: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: filter 120ms ease;
}

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast):not(.swal2-loading) .swal2-actions .swal2-confirm {
    background: var(--swal-fd-accent) !important;
    color: #fff !important;
}

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast):not(.swal2-loading) .swal2-actions .swal2-cancel {
    border: 1px solid #e4e6f0 !important;
    background: #f7f7fb !important;
    color: #6b6b85 !important;
}

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast):not(.swal2-loading) .swal2-actions .swal2-confirm:hover,
.swal2-container .swal2-popup.swal-fd:not(.swal2-toast):not(.swal2-loading) .swal2-actions .swal2-cancel:hover {
    filter: brightness(0.96);
}

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-actions .swal2-confirm:focus,
.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-actions .swal2-cancel:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(76, 63, 158, 0.22) !important;
}

/* ---------- Demais elementos ---------- */

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-close {
    color: #9a9ab3;
    font-size: 26px;
}

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-close:hover {
    color: #6b6b85;
}

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-input,
.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-textarea,
.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-select {
    margin: 0 0 18px;
    padding: 10px 14px;
    border: 1px solid #e4e6f0;
    border-radius: 8px;
    box-shadow: none;
    color: #23223b;
    font-size: 14px;
}

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-input:focus,
.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-textarea:focus,
.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-select:focus {
    border-color: var(--swal-fd-accent);
    box-shadow: 0 0 0 3px rgba(76, 63, 158, 0.12);
}

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-validationerror {
    margin: 0 0 14px;
    border-radius: 6px;
    background: #fbe9ea;
    color: #b3313f;
    font-size: 13px;
}

.swal2-container .swal2-popup.swal-fd:not(.swal2-toast) .swal2-footer {
    margin: 18px 0 0;
    padding: 14px 0 0;
    border-top: 1px solid #eceef5;
    color: #9a9ab3;
    font-size: 12.5px;
}
