*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Tela de Login Unificada */
.login-viewport {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, #1E293B 55%, var(--primary-hover) 100%);
    background-size: cover;
    background-position: center;
}

.login-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, var(--login-overlay, 0.25));
    backdrop-filter: blur(2px);
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 920px;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.38);
}

.login-brand-panel {
    background: linear-gradient(160deg, var(--sidebar-bg) 0%, var(--primary-hover) 100%);
    color: #FFFFFF;
    padding: 44px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
    width: fit-content;
}

.login-brand-panel h1 {
    font-size: 28px;
    font-weight: 700;
    margin-top: 20px;
    line-height: 1.2;
}

.login-brand-panel p.subtitle {
    margin-top: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.brand-features {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    list-style: none;
}

.brand-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.92);
}

.brand-features li span.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #38BDF8;
    flex-shrink: 0;
}

.login-footer-note {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 28px;
}

.login-form-panel {
    padding: 44px 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-form-panel h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
}

.login-form-panel .form-desc {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-main);
    background: #FFFFFF;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 6px;
}

.btn-primary {
    width: 100%;
    height: 44px;
    background: var(--primary);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s;
    margin-top: 6px;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.alert {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.alert-danger {
    background: #FEF2F2;
    color: #991B1B;
    border-color: #FECACA;
}

.alert-success {
    background: #F0FDF4;
    color: #166534;
    border-color: #BBF7D0;
}

.login-links {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
    color: var(--text-muted);
}

.login-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.login-links a:hover {
    text-decoration: underline;
}

@media (max-width: 780px) {
    .login-card {
        grid-template-columns: 1fr;
    }
    .login-brand-panel {
        padding: 30px 28px;
    }
    .login-form-panel {
        padding: 32px 28px;
    }
}