/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animações aprimoradas */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(79, 70, 229, 0.3), 0 8px 24px rgba(79, 70, 229, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(79, 70, 229, 0.5), 0 12px 32px rgba(79, 70, 229, 0.3);
    }
}

/* Container principal */
.login-container {
    width: 100%;
    max-width: 700px;
    padding: 0;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    position: relative;
    z-index: 10;
    animation: slideInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: white;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

/* Logo Section - Left Side */
.logo-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    min-width: 300px;
    text-align: center;
}

.logo-container {
    margin-bottom: 32px;
    position: relative;
}

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

.main-logo {
    width: 160px;
    height: 160px;
    object-fit: contain;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.4));
    animation: floatLogo 5s ease-in-out infinite;
}

.main-logo:hover {
    filter: drop-shadow(0 16px 40px rgba(79, 70, 229, 0.5));
    transform: scale(1.05);
}

.default-logo {
    width: 160px;
    height: 160px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #818cf8 100%);
    background-size: 200% 200%;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 20px 60px rgba(79, 70, 229, 0.3),
        0 8px 24px rgba(0, 0, 0, 0.2),
        inset -2px -2px 6px rgba(255, 255, 255, 0.1),
        inset 2px 2px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: gradientShift 3s ease infinite;
}

.default-logo::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    animation: shimmer 3s infinite;
}

.default-logo:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 28px 72px rgba(79, 70, 229, 0.4),
        0 12px 32px rgba(0, 0, 0, 0.25),
        inset -2px -2px 8px rgba(255, 255, 255, 0.15),
        inset 2px 2px 8px rgba(0, 0, 0, 0.15);
}

.default-logo i {
    font-size: 4rem;
    color: white;
    z-index: 2;
    position: relative;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.brand-message {
    color: white;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.brand-message h2 {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.8px;
    line-height: 1.1;
}

.brand-message p {
    font-size: 1.15rem;
    font-weight: 400;
    opacity: 0.95;
    letter-spacing: 0.4px;
    line-height: 1.6;
}

/* Seção da ilustração */
.login-illustration {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 280px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
}

.login-illustration img {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.15));
    animation: fadeIn 0.8s ease-out 0.2s both;
}

/* Card de login */
.login-card {
    flex: 0 0 340px;
    background: white;
    padding: 28px;
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-card::after {
    display: none;
}

/* Header do login */
.login-header {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    position: relative;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #667eea, #764ba2, #667eea);
    border-radius: 12px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-header:hover .logo::before {
    opacity: 0.5;
}

.login-header:hover .logo {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.4);
}

.logo i {
    font-size: 2rem;
    color: white;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.login-header h1 {
    color: #1a1a2e;
    font-size: 1.65rem;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.login-header p {
    color: #667eea;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* Formulário */
.login-form {
    position: relative;
    z-index: 1;
}

.form-group {
    margin-bottom: 15px;
    position: relative;
}

.form-group label {
    display: block;
    color: #334155;
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 0.8rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.form-group label i {
    margin-right: 5px;
    color: #667eea;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e8eaf6;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: rgba(248, 250, 252, 0.95);
    color: #1a1a2e;
    font-weight: 500;
}

.form-group input::placeholder {
    color: #cbd5e0;
    font-weight: 400;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 1);
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.1),
        0 6px 20px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.form-group input:hover:not(:focus) {
    border-color: #cbd5e0;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.08);
}

/* Botão de login */
.btn-login {
    width: 100%;
    padding: 11px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: 200% 200%;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.93rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    margin-top: 4px;
    letter-spacing: 0.3px;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 10px 28px rgba(102, 126, 234, 0.35),
        0 4px 12px rgba(0, 0, 0, 0.1);
    background-position: 100% 50%;
}

.btn-login:hover::before {
    opacity: 1;
}

.btn-login:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 
        0 6px 16px rgba(102, 126, 234, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-login i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.btn-login:hover i {
    transform: translateX(2px);
}

/* Alertas */
.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 0.85rem;
    font-weight: 500;
    border: 2px solid;
    position: relative;
    z-index: 2;
}

.alert-error {
    background: rgba(254, 226, 226, 0.95);
    color: #7f1d1d;
    border-color: #fca5a5;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.12);
}

.alert-success {
    background: rgba(240, 253, 244, 0.95);
    color: #15803d;
    border-color: #86efac;
    box-shadow: 0 3px 10px rgba(34, 197, 94, 0.12);
}

.alert i {
    font-size: 1rem;
    flex-shrink: 0;
}

/* Estilos para loading do botão */
.btn-loading {
    display: none;
    align-items: center;
    gap: 8px;
}

.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-login:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: scale(0.98);
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #e8eaf6;
    position: relative;
    z-index: 1;
}

.login-footer p {
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* Volta para login do sistema */
.back-to-system {
    text-align: center;
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

.back-to-system a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.2px;
}

.back-to-system a:hover {
    color: #764ba2;
    transform: translateX(-3px);
}

.back-to-system a i {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.back-to-system a:hover i {
    transform: translateX(-2px);
}

/* Responsividade */
@media (max-width: 1024px) {
    .login-container {
        flex-direction: column;
        gap: 0;
        max-width: 420px;
        padding: 0;
        border-radius: 24px;
    }
    
    .logo-section {
        display: none;
    }
    
    .login-illustration {
        min-width: auto;
        width: 100%;
        min-height: 300px;
        padding: 30px;
    }
    
    .login-illustration img {
        max-width: 280px;
    }
    
    .login-card {
        flex: none;
        width: 100%;
        padding: 28px;
    }
}

@media (max-width: 768px) {
    .login-container {
        max-width: 400px;
        padding: 18px;
    }
    
    .login-card {
        padding: 32px;
    }
    
    .login-header h1 {
        font-size: 1.55rem;
    }
    
    .login-header p {
        font-size: 0.85rem;
    }
}

@media (max-width: 600px) {
    .login-container {
        flex-direction: column;
        gap: 0;
        max-width: 100%;
        padding: 0;
        border-radius: 0;
    }
    
    .logo-section {
        display: none;
    }
    
    .login-illustration {
        display: none;
    }
    
    .login-card {
        padding: 24px;
        border-radius: 0;
        flex: 0 0 auto;
        width: 100%;
    }
    
    .login-header h1 {
        font-size: 1.45rem;
    }
    
    .form-group input {
        padding: 11px 13px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .login-container {
        max-width: 360px;
        padding: 12px;
    }
    
    .login-card {
        padding: 24px;
    }
    
    .login-header {
        margin-bottom: 22px;
    }
    
    .login-header h1 {
        font-size: 1.35rem;
    }
    
    .login-header p {
        font-size: 0.85rem;
    }
    
    .logo {
        width: 56px;
        height: 56px;
    }
    
    .logo i {
        font-size: 1.8rem;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group label {
        font-size: 0.75rem;
        margin-bottom: 5px;
    }
    
    .form-group input {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .btn-login {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .back-to-system a {
        font-size: 0.75rem;
    }
    
    .login-footer p {
        font-size: 0.7rem;
    }
}

/* Efeitos de hover e focus complementares */
.form-group input:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.btn-login:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: scale(0.98);
}

.btn-login:disabled:hover {
    transform: scale(0.98);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

/* Animação de loading */
.btn-login.loading {
    position: relative;
    color: transparent;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { 
        transform: rotate(0deg); 
    }
    100% { 
        transform: rotate(360deg); 
    }
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(79, 70, 229, 0.4);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 70, 229, 0.6);
}
