/* /css/login.css */

:root {
    --primary-color: #6366f1;
    /* Indigo 500 */
    --primary-dark: #4f46e5;
    /* Indigo 600 */
    --primary-light: #818cf8;
    /* Indigo 400 */
    --dark-color: #0f172a;
    /* Slate 900 */
    --light-color: #f8fafc;
    /* Slate 50 */
    --gray-color: #64748b;
    /* Slate 500 */
    --border-color: #e2e8f0;
    /* Slate 200 */
    --error-color: #ef4444;
    --success-color: #10b981;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --font-family-base: 'Outfit', -apple-system, system-ui, sans-serif;

    /* Gradient for Branding Panel */
    --brand-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family-base);
}

body.login-page {
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.login-page-wrapper {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

/* --- Painel de Branding (Esquerdo) --- */
.login-branding-panel {
    flex: 1.2;
    /* Slightly larger */
    background: var(--brand-gradient);
    color: white;
    padding: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.4;
}

.branding-content {
    position: relative;
    z-index: 1;
    max-width: 550px;
    text-align: center;
    animation: slide-up 0.8s ease-out;
}

.brand-logo-img {
    max-width: 80%;
    max-height: 160px;
    height: auto;
    margin-bottom: 2.5rem;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    transition: transform 0.5s ease;
}

.brand-logo-img:hover {
    transform: scale(1.02);
}

.polo-name {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.system-description {
    font-size: 1.2rem;
    font-weight: 400;
    color: #cbd5e1;
    /* Slate 300 */
    line-height: 1.6;
}

/* --- Painel de Formulário (Direito) --- */
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background-color: white;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 2;
}

.login-container {
    max-width: 420px;
    width: 100%;
    animation: fade-in 1s ease-out;
}

.login-header {
    margin-bottom: 3rem;
    text-align: center;
}

.login-header h1 {
    font-size: 2.25rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.login-header p {
    color: var(--gray-color);
    font-size: 1.1rem;
}

/* Inputs Modernos */
.input-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

.input-wrapper input {
    width: 100%;
    padding: 1.2rem 1rem 1.2rem 3.5rem;
    /* Taller inputs */
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 1rem;
    background-color: #f1f5f9;
    color: var(--dark-color);
    transition: all 0.2s;
    font-weight: 500;
}

.input-wrapper .icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    color: #94a3b8;
    transition: var(--transition);
    z-index: 2;
}

.input-wrapper label {
    position: absolute;
    left: 3.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
    transition: all 0.2s;
    font-size: 1rem;
    background: transparent;
}

/* Focus State */
.input-wrapper input:focus,
.input-wrapper input:not(:placeholder-shown) {
    background-color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.input-wrapper input:focus+label,
.input-wrapper input:not(:placeholder-shown)+label {
    top: -10px;
    left: 1rem;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    background: white;
    padding: 0 6px;
}

.input-wrapper input:focus~.icon {
    color: var(--primary-color);
}

.password-toggle {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: var(--primary-color);
}

/* Button Premium */
.btn-login {
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    letter-spacing: 0.02em;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.5);
    background: linear-gradient(135deg, #818cf8, #4f46e5);
}

.btn-login:active {
    transform: translateY(-1px);
}

/* Messages */
#message {
    margin-top: 2rem;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    font-weight: 500;
    font-size: 0.95rem;
    display: none;
}

#message.error {
    background-color: #fef2f2;
    color: var(--error-color);
    border: 1px solid #fecaca;
}

#message.success {
    background-color: #ecfdf5;
    color: var(--success-color);
    border: 1px solid #a7f3d0;
}

/* Animations */
@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.btn-login .spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-login.loading .spinner {
    display: block;
}

.btn-login.loading span {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 900px) {
    .login-branding-panel {
        display: none;
    }

    .login-form-panel {
        padding: 2rem;
    }

    .login-header h1 {
        font-size: 1.75rem;
    }
}