:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-animated: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c, #4facfe, #00f2fe);
    --border-radius-lg: 2rem;
    --border-radius-md: 1.25rem;
    --border-radius-sm: 1rem;
    --shadow-light: 0 8px 25px rgba(102, 126, 234, 0.1);
    --shadow-medium: 0 15px 40px rgba(102, 126, 234, 0.25);
    --shadow-heavy: 0 25px 80px rgba(0, 0, 0, 0.2);
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

/* Layout Base */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gradient-animated);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    margin: 0;
    overflow-x: hidden;
}

/* Animações */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(180deg); }
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

@keyframes particleFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-30px) rotate(120deg); }
    66% { transform: translateY(30px) rotate(240deg); }
}

/* Container Principal */
.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-heavy), 0 0 0 1px rgba(255, 255, 255, 0.3);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    animation: slideUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition-smooth);
}

.login-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.4);
}

/* Header */
.login-header {
    background: var(--gradient-1);
    color: white;
    padding: 3rem 2rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    animation: float 8s ease-in-out infinite;
}

.login-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem auto;
    display: block;
    border-radius: 50%;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.95);
    border: 4px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 2;
    animation: logoFloat 3s ease-in-out infinite;
    padding: 15px;
}

.login-header h2 {
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    font-size: 2rem;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-header p {
    margin: 0;
    opacity: 0.95;
    font-size: 1rem;
    position: relative;
    z-index: 2;
    font-weight: 400;
}

/* Body */
.login-body {
    padding: 3rem 2rem;
    background: rgba(255, 255, 255, 0.9);
}

/* Formulário */
.form-floating {
    margin-bottom: 2rem;
    position: relative;
}

.form-control {
    border-radius: var(--border-radius-md);
    border: 2px solid rgba(102, 126, 234, 0.1);
    padding: 1.5rem 1.5rem 0.75rem 1.5rem;
    font-size: 1rem;
    transition: var(--transition-smooth);
    background: rgba(248, 250, 252, 0.8);
    height: 4rem;
    backdrop-filter: blur(10px);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.15), var(--shadow-light);
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-3px);
}

.form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1.25rem 1.5rem;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: var(--transition-fast);
    color: #64748b;
    font-weight: 500;
}

.form-control:focus ~ label,
.form-control:not(:placeholder-shown) ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
    color: var(--primary-color);
}

/* Botão */
.btn-login {
    background: var(--gradient-1);
    border: none;
    border-radius: var(--border-radius-md);
    padding: 1.25rem 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    width: 100%;
    margin-bottom: 1.5rem;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s;
}

.btn-login:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
    background: var(--gradient-2);
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:active {
    transform: translateY(-2px);
}

/* Elementos auxiliares */
.security-badge {
    background: rgba(241, 245, 249, 0.8);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-sm);
    padding: 1.25rem;
    text-align: center;
    margin-top: 2rem;
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.security-badge i {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    display: block;
}

.security-badge small {
    color: #64748b !important;
    font-size: 0.875rem;
    font-weight: 500;
}

.alert {
    border: none;
    border-radius: var(--border-radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    animation: shake 0.6s ease-in-out;
    backdrop-filter: blur(10px);
}

.forgot-password {
    text-align: center;
    margin-top: 1.5rem;
}

.forgot-password a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition-fast);
    position: relative;
}

.forgot-password a:hover {
    color: var(--secondary-color);
    transform: translateY(-1px);
}

.forgot-password a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 50%;
    background: var(--gradient-1);
    transition: var(--transition-fast);
    transform: translateX(-50%);
}

.forgot-password a:hover::after {
    width: 100%;
}

/* Efeito de partículas no fundo */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        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, 200, 255, 0.3) 0%, transparent 50%);
    z-index: -1;
    animation: particleFloat 20s ease-in-out infinite;
}

/* Responsividade Mobile */
@media (max-width: 576px) {
    body {
        padding: 0.5rem;
    }
    
    .login-container {
        max-width: 100%;
        margin: 0.5rem;
        border-radius: 1.5rem;
    }
    
    .login-header {
        padding: 2rem 1.5rem 1.5rem;
    }
    
    .login-logo {
        width: 100px;
        height: 100px;
        margin-bottom: 1rem;
    }
    
    .login-header h2 {
        font-size: 1.75rem;
    }
    
    .login-body {
        padding: 2rem 1.5rem;
    }
    
    .form-control {
        height: 3.5rem;
        padding: 1.25rem 1.25rem 0.75rem 1.25rem;
    }
    
    .btn-login {
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
    }
}


/* Flash Messages específicas para Login */
.login-container .flash-message {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    min-width: auto;
    max-width: none;
    width: 100%;
    margin-bottom: 1.5rem;
    z-index: 10;
    animation: slideInDown 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.login-container .flash-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: hidden;
}

/* Tipos de mensagens para login */
.login-container .flash-error .flash-content {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    border-left: 4px solid #ff4757;
}

.login-container .flash-success .flash-content {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    color: white;
    border-left: 4px solid #2ed573;
}

.login-container .flash-info .flash-content {
    background: linear-gradient(135deg, #339af0 0%, #228be6 100%);
    color: white;
    border-left: 4px solid #0984e3;
}

.login-container .flash-warning .flash-content {
    background: linear-gradient(135deg, #ffd43b 0%, #fab005 100%);
    color: #333;
    border-left: 4px solid #f39c12;
}

/* Layout interno das mensagens */
.login-container .flash-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.login-container .flash-icon i {
    font-size: 20px;
    opacity: 0.9;
}

.login-container .flash-text {
    flex: 1;
    min-width: 0;
}

.login-container .flash-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    opacity: 0.95;
}

.login-container .flash-message-text {
    font-size: 13px;
    line-height: 1.4;
    opacity: 0.9;
    word-wrap: break-word;
}

/* Botão de fechar */
.login-container .flash-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.7;
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container .flash-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.login-container .flash-close i {
    font-size: 12px;
}

/* Barra de progresso */
.login-container .flash-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    animation: progressBar 5s linear forwards;
}

/* Animações específicas para login */
@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

.login-container .flash-message.fade-out {
    animation: slideOutUp 0.3s ease-in-out forwards;
}

@keyframes slideOutUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}

/* Estados de hover */
.login-container .flash-message:hover {
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.login-container .flash-message:hover .flash-progress {
    animation-play-state: paused;
}

.login-container .flash-message:hover .flash-progress {
    animation-play-state: paused;
}