/**
 * Reset mínimo – layout e componentes usam Tailwind nas views
 * WebView: bloqueio de zoom via viewport; imagens estáveis e touch-action
 */
* {
    box-sizing: border-box;
}

/* WebView: reduzir gestos de zoom (mantém scroll e tap) */
html, body {
    touch-action: manipulation;
}

/* Imagens: proporção estável, sem esticamento ao navegar */
img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Bolinha vermelha piscando para indicar cadastro incompleto */
.cadastro-incompleto-badge {
    display: inline-block !important;
    width: 12px !important;
    height: 12px !important;
    min-width: 12px !important;
    min-height: 12px !important;
    background-color: #ef4444 !important;
    border-radius: 50% !important;
    margin-left: 8px !important;
    animation: blinkRed 1s ease-in-out infinite !important;
    -webkit-animation: blinkRed 1s ease-in-out infinite !important;
    vertical-align: middle !important;
    flex-shrink: 0 !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 3px rgba(239, 68, 68, 0.4) !important;
    will-change: opacity, transform !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Posicionamento absoluto para badges em ícones */
.cadastro-incompleto-badge.absolute {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
    min-height: 14px !important;
    margin-left: 0 !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 1), 0 0 0 3px rgba(239, 68, 68, 0.5) !important;
    z-index: 20 !important;
}

@keyframes blinkRed {
    0% {
        opacity: 1;
        transform: scale(1);
        background-color: #ef4444;
    }
    50% {
        opacity: 0.3;
        transform: scale(0.75);
        background-color: #dc2626;
    }
    100% {
        opacity: 1;
        transform: scale(1);
        background-color: #ef4444;
    }
}

@-webkit-keyframes blinkRed {
    0% {
        opacity: 1;
        -webkit-transform: scale(1);
        transform: scale(1);
        background-color: #ef4444;
    }
    50% {
        opacity: 0.3;
        -webkit-transform: scale(0.75);
        transform: scale(0.75);
        background-color: #dc2626;
    }
    100% {
        opacity: 1;
        -webkit-transform: scale(1);
        transform: scale(1);
        background-color: #ef4444;
    }
}

/* Toast de confirmação - canto inferior para não sobrepor header */
#toast-container.toast-container {
    position: fixed !important;
    bottom: 5rem !important;
    right: 1rem !important;
    top: auto !important;
    left: auto !important;
    z-index: 99999 !important;
    display: flex !important;
    flex-direction: column-reverse !important;
    align-items: flex-end !important;
    gap: 0.5rem !important;
    width: 300px !important;
    max-width: min(300px, calc(100vw - 2rem)) !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.toast-container .toast {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.75rem 1rem !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    transition: opacity 0.2s ease !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
}

.toast-container .toast--enter {
    opacity: 0 !important;
}

.toast-container .toast:not(.toast--enter):not(.toast--leave) {
    opacity: 1 !important;
}

.toast-container .toast--leave {
    opacity: 0 !important;
}

.toast--success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.toast--success .toast-icon {
    color: #059669;
    flex-shrink: 0;
}

.toast--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.toast--error .toast-icon {
    color: #dc2626;
    flex-shrink: 0;
}

.toast--info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.toast--info .toast-icon {
    color: #2563eb;
    flex-shrink: 0;
}

.toast-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

@media (max-width: 640px) {
    #toast-container.toast-container {
        left: 1rem !important;
        right: 1rem !important;
        top: auto !important;
        bottom: 5.5rem !important;
        width: auto !important;
        max-width: calc(100vw - 2rem) !important;
    }
}

/* Animação de sino balançando para notificação */
@keyframes bellShake {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-10deg); }
    20%, 40% { transform: rotate(10deg); }
    50% { transform: rotate(-8deg); }
    60% { transform: rotate(8deg); }
    70% { transform: rotate(-4deg); }
    80% { transform: rotate(4deg); }
    90% { transform: rotate(-2deg); }
}

.animate-bell-shake {
    animation: bellShake 1.5s ease-in-out infinite;
}