@import "ceisc-palette.css";

* {
    font-family: 'Poppins', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg, var(--ceisc-azul) 0%, var(--ceisc-azul-700) 50%, var(--ceisc-azul-900) 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Acessibilidade: foco visível (teclado) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--ceisc-azul-300);
    outline-offset: 2px;
}

/* Animação de entrada para elementos em lista */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Particulas animadas */
.bg-bubbles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-bubbles li {
    position: absolute;
    list-style: none;
    display: block;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    bottom: -150px;
    animation: rise 25s infinite ease-in;
    border-radius: 50%;
}

.bg-bubbles li:nth-child(1) { width: 80px; height: 80px; left: 10%; animation-delay: 0s; }
.bg-bubbles li:nth-child(2) { width: 20px; height: 20px; left: 20%; animation-delay: 2s; animation-duration: 17s; }
.bg-bubbles li:nth-child(3) { width: 50px; height: 50px; left: 35%; animation-delay: 4s; }
.bg-bubbles li:nth-child(4) { width: 60px; height: 60px; left: 50%; animation-delay: 0s; animation-duration: 22s; }
.bg-bubbles li:nth-child(5) { width: 20px; height: 20px; left: 65%; animation-delay: 0s; }
.bg-bubbles li:nth-child(6) { width: 110px; height: 110px; left: 75%; animation-delay: 3s; }
.bg-bubbles li:nth-child(7) { width: 150px; height: 150px; left: 85%; animation-delay: 7s; }
.bg-bubbles li:nth-child(8) { width: 25px; height: 25px; left: 90%; animation-delay: 15s; animation-duration: 45s; }

@keyframes rise {
    0% { bottom: -150px; transform: translateX(0) rotate(0deg); opacity: 0.5; }
    50% { opacity: 0.2; }
    100% { bottom: 110%; transform: translateX(100px) rotate(720deg); opacity: 0; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Alerts customizados - paleta Ceisc */
.alert-success {
    background: linear-gradient(135deg, var(--ceisc-verde-800) 0%, var(--ceisc-verde-400) 100%);
    border: none;
    color: white;
    border-radius: 12px;
    font-weight: 500;
}

.alert-danger {
    background: linear-gradient(135deg, var(--ceisc-salmao-800) 0%, var(--ceisc-salmao-400) 100%);
    border: none;
    color: white;
    border-radius: 12px;
    font-weight: 500;
}

.alert-warning {
    background: linear-gradient(135deg, var(--ceisc-amarelo-800) 0%, var(--ceisc-amarelo-400) 100%);
    border: none;
    color: var(--ceisc-azul-900);
    border-radius: 12px;
    font-weight: 500;
}

/* Utilitário: animação de entrada em sequência (stagger) */
.stagger-in > * {
    animation: fadeInUp 0.5s ease-out backwards;
}
.stagger-in > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-in > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-in > *:nth-child(8) { animation-delay: 0.4s; }
.stagger-in > *:nth-child(9) { animation-delay: 0.45s; }
.stagger-in > *:nth-child(n+10) { animation-delay: 0.5s; }

/* Botão Voltar ao topo */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--ceisc-azul);
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 80, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.2s, box-shadow 0.3s;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    background: var(--ceisc-azul-700);
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0, 80, 255, 0.45);
}
.back-to-top:active {
    transform: translateY(-1px);
}

/* Respeitar preferência de reduzir movimento (acessibilidade) */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}
