* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #1040a2;
    --secondary-blue: #023866;
    --text-dark: #1a1a1a;
    --text-gray: #6b7280;
    --text-light: #9ca3af;
    --border-color: #e5e7eb;
    --bg-light: #f9fafb;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
    perspective: 1000px;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Container de efeitos de background */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Círculos pulsantes - Efeito de água */
.pulse-circle {
    position: absolute;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: pulseExpand 4s infinite ease-out;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.pulse-1 {
    width: 120px;
    height: 120px;
    top: 15%;
    left: 20%;
    animation-duration: 4s;
    animation-delay: 0s;
}

.pulse-2 {
    width: 180px;
    height: 180px;
    bottom: 20%;
    right: 25%;
    animation-duration: 5s;
    animation-delay: -1s;
}

.pulse-3 {
    width: 100px;
    height: 100px;
    top: 45%;
    left: 10%;
    animation-duration: 4.5s;
    animation-delay: -2s;
}


@keyframes pulseExpand {
    0% {
        transform: scale(1);
        opacity: 0.7;
        border-width: 3px;
    }
    50% {
        opacity: 0.4;
        border-width: 2px;
    }
    100% {
        transform: scale(3);
        opacity: 0;
        border-width: 1px;
    }
}

.login-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 10;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-box {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: var(--shadow-2xl), 0 0 0 1px rgba(255, 255, 255, 0.1);
    padding: 48px 40px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    animation: scaleIn 0.5s ease-out 0.2s both;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.logo {
    max-width: 160px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.system-name {
    text-align: center;
    color: var(--text-dark);
    font-family: 'Poppins', sans-serif;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeIn 0.6s ease-out 0.3s both;
}

.welcome-text {
    text-align: center;
    color: var(--text-gray);
    font-size: 15px;
    font-weight: 400;
    margin-bottom: 36px;
    letter-spacing: 0.2px;
    animation: fadeIn 0.6s ease-out 0.4s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.login-form {
    margin-top: 32px;
    animation: fadeIn 0.6s ease-out 0.5s both;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-family: 'Inter', sans-serif;
}

.form-group input:hover {
    border-color: rgba(16, 64, 162, 0.3);
    background-color: var(--white);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-blue);
    background-color: var(--white);
    box-shadow: 0 0 0 4px rgba(16, 64, 162, 0.1), var(--shadow-md);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: var(--text-light);
    font-weight: 400;
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 52px;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    transition: all 0.2s ease;
    border-radius: 8px;
}

.toggle-password:hover {
    color: var(--primary-blue);
    background-color: rgba(16, 64, 162, 0.05);
}

.toggle-password:focus {
    outline: none;
    background-color: rgba(16, 64, 162, 0.1);
}

.toggle-password svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.eye-icon-hidden {
    display: none;
}

.toggle-password.active .eye-icon:not(.eye-icon-hidden) {
    display: none;
}

.toggle-password.active .eye-icon-hidden {
    display: block;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-gray);
    font-weight: 500;
    user-select: none;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--primary-blue);
    border-radius: 4px;
}

.forgot-password {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
}

.forgot-password::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    transition: width 0.3s ease;
}

.forgot-password:hover {
    color: var(--secondary-blue);
}

.forgot-password:hover::after {
    width: 100%;
}

.login-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(16, 64, 162, 0.4), var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.login-button:hover::before {
    left: 100%;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 64, 162, 0.5), var(--shadow-lg);
}

.login-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(16, 64, 162, 0.4);
}

.login-button:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(16, 64, 162, 0.2), 0 4px 14px rgba(16, 64, 162, 0.4);
}

.login-button span {
    position: relative;
    z-index: 1;
}

.footer-text {
    margin-top: 32px;
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.footer-text p {
    color: var(--text-light);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.2px;
}

/* Responsividade */
@media (max-width: 480px) {
    .login-box {
        padding: 36px 24px;
        border-radius: 20px;
    }
    
    .system-name {
        font-size: 28px;
    }
    
    .logo {
        max-width: 140px;
    }
    
    .form-group input {
        padding: 12px 16px;
        font-size: 16px;
    }
}

/* Estados de erro */
.form-group.error input {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.form-group.error label {
    color: #ef4444;
}

.error-message {
    color: #ef4444;
    font-size: 13px;
    margin-top: 8px;
    margin-bottom: 16px;
    display: block;
    font-weight: 500;
    padding: 12px 16px;
    background: #fef2f2;
    border-radius: 10px;
    border-left: 4px solid #ef4444;
    animation: shake 0.4s ease;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Melhorias de acessibilidade */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
