/* ============================================
   ANIMAÇÕES E UX POLISH
   ============================================ */

/* Shake animation para erros */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

/* Fade in suave */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Slide up */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Spinner de loading */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Aplicações */
.list-item {
    animation: slideUp 0.3s ease;
}

.toast {
    animation: slideUp 0.3s ease;
}

/* Estados de input */
.input-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.input-success {
    border-color: #22c55e !important;
    background-color: #f0fdf4 !important;
}

.error-message {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: fadeIn 0.2s ease;
}

.error-message::before {
    content: '⚠️';
}

.char-counter {
    text-align: right;
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 6px;
    transition: color 0.3s ease;
}

.char-counter.warning {
    color: #f59e0b;
    font-weight: 600;
}

.char-counter.limit {
    color: #ef4444;
    font-weight: 700;
}

/* Loading states */
.btn-loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

.btn-secondary .spinner {
    border-color: #64748b;
    border-top-color: transparent;
}

/* Transições suaves em todos os elementos interativos */
input, textarea, select, .btn {
    transition: all 0.2s ease;
}

/* Hover effects melhorados */
.btn:active {
    transform: scale(0.98);
}

/* Focus ring acessível */
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Modal de confirmação */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.confirm-modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    max-width: 400px;
    text-align: center;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.confirm-modal h3 {
    margin-bottom: 15px;
    color: var(--text);
}

.confirm-modal p {
    color: var(--text-light);
    margin-bottom: 25px;
}

.confirm-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}