:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-light: #95a5a6;
    --input-bg: #f8f9fa;
    --input-border: #e9ecef;
    --input-focus: #667eea;
    --button-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --button-hover: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    --error-bg: #ffebee;
    --error-text: #c62828;
    --error-border: #c62828;
    --success-bg: #e8f5e8;
    --success-text: #2e7d32;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Elementos decorativos de fundo */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.login-container {
    width: 100%;
    max-width: 420px;
    animation: slideInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    position: relative;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.logo-section {
    background: var(--primary-gradient);
    padding: 50px 40px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.logo-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%) translateY(-100%); }
    50% { transform: translateX(100%) translateY(100%); }
}

.logo-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 25px;
}

.login-logo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: white;
    padding: 18px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.logo-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    animation: pulse-glow 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.login-logo:hover {
    transform: scale(1.05) rotate(5deg);
}

.system-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
    letter-spacing: -0.5px;
}

.system-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 400;
    position: relative;
    z-index: 2;
    font-style: italic;
    margin-bottom: 20px;
}

.brand-line {
    width: 60px;
    height: 2px;
    background: rgba(255, 255, 255, 0.6);
    margin: 0 auto;
    border-radius: 1px;
    position: relative;
    z-index: 2;
}

.login-section {
    padding: 50px 40px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.login-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 35px;
    gap: 15px;
}

.login-header h2 {
    color: var(--text-primary);
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0;
    position: relative;
}

.security-icon {
    color: var(--text-primary);
    animation: bounce 2s ease-in-out infinite;
}

.security-icon svg {
    width: 20px;
    height: 20px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

.error-message {
    background: var(--error-bg);
    color: var(--error-text);
    padding: 18px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 4px solid var(--error-border);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(198, 40, 40, 0.1);
    animation: shake 0.5s ease-in-out;
    display: flex;
    align-items: center;
    gap: 12px;
}

.error-icon {
    color: var(--error-text);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.error-icon svg {
    width: 16px;
    height: 16px;
}

.error-text {
    flex: 1;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.input-group {
    margin-bottom: 28px;
    position: relative;
}

.input-group label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    gap: 8px;
}

.label-icon {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

.label-icon svg {
    width: 16px;
    height: 16px;
}

.input-group.focused .label-icon {
    color: var(--input-focus);
}

.input-group input {
    width: 100%;
    padding: 18px 24px;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.input-group input:focus {
    outline: none;
    border-color: var(--input-focus);
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.input-group input::placeholder {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 400;
}

.input-group input:focus::placeholder {
    opacity: 0.7;
}

.input-focus-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--input-focus);
    transition: width 0.3s ease;
    border-radius: 1px;
}

.input-group input:focus + .input-focus-line {
    width: 100%;
}

button[type="submit"] {
    width: 100%;
    padding: 20px;
    background: var(--button-bg);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.button-text {
    text-align: center;
}

button[type="submit"]::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;
}

button[type="submit"]:hover {
    background: var(--button-hover);
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

button[type="submit"]:hover::before {
    left: 100%;
}

button[type="submit"]:active {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.login-footer {
    margin-top: 30px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.footer-text {
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 400;
    margin: 0;
    opacity: 0.8;
}

/* Animações de entrada */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsividade aprimorada */
@media (max-width: 480px) {
    body {
        padding: 15px;
    }
    
    .login-container {
        max-width: 100%;
    }
    
    .logo-section {
        padding: 40px 25px;
    }
    
    .login-section {
        padding: 40px 25px;
    }
    
    .login-logo {
        width: 80px;
        height: 80px;
        padding: 15px;
    }
    
    .system-title {
        font-size: 1.7rem;
    }
    
    .login-section h2 {
        font-size: 1.4rem;
    }
    
    .input-group input {
        padding: 16px 20px;
    }
    
    button[type="submit"] {
        padding: 18px;
    }
}

@media (max-width: 360px) {
    .logo-section {
        padding: 35px 20px;
    }
    
    .login-section {
        padding: 35px 20px;
    }
    
    .system-title {
        font-size: 1.5rem;
    }
}

/* Melhorias de acessibilidade */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    body::before {
        animation: none;
    }
}

/* Estados de foco aprimorados */
button:focus,
input:focus {
    outline: 3px solid rgba(102, 126, 234, 0.3);
    outline-offset: 2px;
}

/* Efeito de loading no botão */
button[type="submit"].loading {
    pointer-events: none;
    opacity: 0.8;
}

button[type="submit"].loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Efeito de partículas sutis */
.login-card::after {
    content: '';
    position: absolute;
    top: 20px;
    right: 20px;
    width: 4px;
    height: 4px;
    background: rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}